github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/webapp/components/test/util/helpers.js (about) 1 /** 2 * Copyright 2018 The WPT Dashboard Project. All rights reserved. 3 * Use of this source code is governed by a BSD-style license that can be 4 * found in the LICENSE file. 5 */ 6 7 async function waitingOn(predicate) { 8 return await new Promise(resolve => { 9 let interval = setInterval(() => { 10 if (predicate()) { 11 clearInterval(interval); 12 resolve(); 13 } 14 }, 0); 15 }); 16 } 17 18 const TEST_RUNS_DATA = [ 19 { 20 id: 123, 21 browser_name: 'chrome', 22 browser_version: '63.0', 23 os_name: 'linux', 24 os_version: '*', 25 revision: '53c5bf648c', 26 results_url: 'https://storage.googleapis.com/wptd/53c5bf648c/chrome-63.0-linux-summary_v2.json.gz', 27 created_at: '2018-01-09T15:47:03.949Z', 28 }, 29 { 30 id: 234, 31 browser_name: 'edge', 32 browser_version: '15', 33 os_name: 'windows', 34 os_version: '10', 35 revision: '03d67ae5d9', 36 results_url: 'https://storage.googleapis.com/wptd/03d67ae5d9/edge-15-windows-10-summary_v2.json.gz', 37 created_at: '2018-01-17T10:11:24.678461Z', 38 }, 39 { 40 id: 345, 41 browser_name: 'firefox', 42 browser_version: '57.0', 43 os_name: 'linux', 44 os_version: '*', 45 revision: '1f9c924a4b', 46 results_url: 'https://storage.googleapis.com/wptd/1f9c924a4b/firefox-57.0-linux-summary_v2.json.gz', 47 created_at: '2018-01-09T15:54:04.296Z', 48 }, 49 { 50 id: 456, 51 browser_name: 'safari', 52 browser_version: '11.0', 53 os_name: 'macos', 54 os_version: '10.12', 55 revision: '3b19057653', 56 results_url: 'https://storage.googleapis.com/wptd/3b19057653/safari-11.0-macos-10.12-summary_v2.json.gz', 57 created_at: '2018-01-01T17:59:48.129561Z', 58 } 59 ]; 60 61 export { waitingOn, TEST_RUNS_DATA };