|
2 | 2 | /* vim: set ts=4 et sw=4 tw=80: */
|
3 | 3 |
|
4 | 4 | /*
|
5 |
| - Massage each engines data into a nice indexed |
| 5 | + Get the latest aligned run data from WPT, |
| 6 | + massage it into a nice indexed |
6 | 7 | result set (testPath:result) for quick reference
|
7 | 8 | */
|
| 9 | +let wptDataPromise = async function () { |
| 10 | + let f = await fetch('https://wpt.fyi/api/runs?aligned'); |
| 11 | + let data = await f.json(); |
| 12 | + let ids = data.map(rec => rec.id).join(); |
8 | 13 |
|
| 14 | + // Note: this may get a bit "too much", but it doesn't matter to results |
| 15 | + f = await fetch(`https://wpt.fyi/api/search?label=master&label=experimental&q=math&run_ids=${ids}`); |
| 16 | + data = await f.json(); |
9 | 17 |
|
10 |
| -async function getBrowserWPTData(browser) { |
11 |
| - let ret = { |
12 |
| - engine: browser, |
13 |
| - results: {} |
14 |
| - } |
15 |
| - let data = await fetchWebPlatformTestResults(browser); |
16 |
| - data.results.forEach(item => { |
17 |
| - if (item.status === "OK") { |
18 |
| - // Check all the subtests. |
19 |
| - item.status = "FAIL"; |
20 |
| - if (item.subtests && item.subtests.length > 0) { |
21 |
| - item.status = "PASS"; |
22 |
| - for (i in item.subtests) { |
23 |
| - if (item.subtests[i].status !== "PASS") { |
24 |
| - item.status = "FAIL"; |
25 |
| - break; |
26 |
| - } |
27 |
| - } |
28 |
| - } |
29 |
| - } |
30 |
| - ret.results[item.test] = item.status; |
31 |
| - }) |
32 |
| - return ret |
33 |
| -} |
| 18 | + return data.runs.map((run, i) => { |
| 19 | + let retVal = { |
| 20 | + engine: run.browser_name, |
| 21 | + results: {} |
| 22 | + }; |
34 | 23 |
|
35 |
| -/* |
36 |
| - We can launch these early and get data |
37 |
| -*/ |
38 |
| -let wptDataPromise = Promise.all([ |
39 |
| -// getBrowserWPTData('blink'), |
40 |
| - getBrowserWPTData('chrome'), |
41 |
| - getBrowserWPTData('firefox'), |
42 |
| - getBrowserWPTData('safari') |
43 |
| -]) |
| 24 | + data.results.forEach((item) => { |
| 25 | + retVal.results[item.test] = ( |
| 26 | + item.legacy_status[i].passes |
| 27 | + == |
| 28 | + item.legacy_status[i].total |
| 29 | + ) |
| 30 | + ? |
| 31 | + "PASS" |
| 32 | + : |
| 33 | + "FAIL"; |
| 34 | + |
| 35 | + }) |
| 36 | + return retVal; |
| 37 | + }); |
| 38 | +}(); |
44 | 39 |
|
45 | 40 | /*
|
46 | 41 | Before we start, re-attach
|
@@ -83,7 +78,7 @@ async function loadWebPlaformTestsResults() {
|
83 | 78 | let ENGINE_LOGOS = {
|
84 | 79 | 'firefox': "https://test.csswg.org/harness/img/gecko.svg",
|
85 | 80 | 'safari': "https://test.csswg.org/harness/img/webkit.svg",
|
86 |
| - // 'blink': "https://pbs.twimg.com/profile_images/1576817016/igalia_400x400.png", |
| 81 | + 'edge': "https://test.csswg.org/harness/img/edge.svg", |
87 | 82 | 'chrome': "https://test.csswg.org/harness/img/blink.svg",
|
88 | 83 | };
|
89 | 84 |
|
@@ -143,7 +138,7 @@ async function loadWebPlaformTestsResults() {
|
143 | 138 | let frag = document.createRange().createContextualFragment(source);
|
144 | 139 | annotationEl.appendChild(frag);
|
145 | 140 |
|
146 |
| - }); |
147 | 141 |
|
| 142 | + }); |
148 | 143 | document.getElementById("implementation-report").insertAdjacentHTML("beforeend", `<div style="margin-left: 2em; margin-right: 2em"><a href="${respecConfig.implementationReportURI}">Implementation Report</a></div>`);
|
149 | 144 | }
|
0 commit comments