Bug 1591647 [wpt PR 19913] - [preload] Opt-in to single-page test feature, a=testonly
authorjugglinmike <mike@mikepennisi.com>
Mon, 04 Nov 2019 11:07:42 +0000
changeset 502872 66c0572d04379341d055c7f61355d0203bc05f03
parent 502871 f5e4cd294cc8f952894e39be1420596da582afb3
child 502873 581f7bc35dabee88bf600ed5d5aad2b408319786
push id101053
push userwptsync@mozilla.com
push dateWed, 20 Nov 2019 11:26:19 +0000
treeherderautoland@3a7cd133fa3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1591647, 19913, 19449
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1591647 [wpt PR 19913] - [preload] Opt-in to single-page test feature, a=testonly Automatic update from web-platform-tests [preload] Opt-in to single-page test feature (#19913) testharness.js was recently extended with an API to explicitly opt-in to the "single page test" feature [1]. As per WPT RFC 28 [2], tests which do not use this API and which do not declare any subtests will soon be reported as a harness error. Update the tests which previously opted in implicitly to use the new API. [1] https://github.com/web-platform-tests/wpt/pull/19449 [2] https://github.com/web-platform-tests/rfcs/blob/master/rfcs/single_test.md -- wpt-commits: 306dc506adba97ca84ada67bdab6227dba65bbcb wpt-pr: 19913 Differential Revision: https://phabricator.services.mozilla.com/D53494
testing/web-platform/tests/preload/download-resources.html
testing/web-platform/tests/preload/link-header-on-subresource.html
testing/web-platform/tests/preload/link-header-preload-imagesrcset.html
testing/web-platform/tests/preload/link-header-preload-nonce.html
testing/web-platform/tests/preload/link-header-preload.html
testing/web-platform/tests/preload/onerror-event.html
testing/web-platform/tests/preload/onload-event.html
testing/web-platform/tests/preload/preload-with-type.html
testing/web-platform/tests/preload/single-download-late-used-preload.html
--- a/testing/web-platform/tests/preload/download-resources.html
+++ b/testing/web-platform/tests/preload/download-resources.html
@@ -10,17 +10,17 @@
 <link rel=preload href="resources/white.mp4" as=video>
 <link rel=preload href="resources/sound_5.oga" as=audio>
 <link rel=preload href="resources/foo.vtt" as=track>
 <link rel=preload href="resources/dummy.xml?foo=bar" as=foobarxmlthing>
 <link rel=preload href="resources/dummy.xml?novalue">
 <link rel=preload href="resources/dummy.xml" as="fetch">
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (numberOfResourceTimingEntries("resources/dummy.js") == 1 &&
             numberOfResourceTimingEntries("resources/dummy.css") == 1 &&
             numberOfResourceTimingEntries("/fonts/CanvasTest.ttf") == 1 &&
             numberOfResourceTimingEntries("resources/white.mp4") == 1 &&
--- a/testing/web-platform/tests/preload/link-header-on-subresource.html
+++ b/testing/web-platform/tests/preload/link-header-on-subresource.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <title>Makes sure that Link headers on subresources preload resources</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/preload/resources/preload_helper.js"></script>
 <link rel=stylesheet href="resources/dummy-preloads-subresource.css?link-header-on-subresource">
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (numberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource") == 1) {
             done();
         }
         iterations++;
--- a/testing/web-platform/tests/preload/link-header-preload-imagesrcset.html
+++ b/testing/web-platform/tests/preload/link-header-preload-imagesrcset.html
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
 <title>Makes sure that Link headers preload images with imagesrcset/imagesizes attributes.</title>
 <link rel="help" href="https://github.com/w3c/preload/issues/120">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/preload/resources/preload_helper.js"></script>
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
     var expectation = new Array(10).fill(0);
     if (window.devicePixelRatio < 1.5) {
         expectation[0] = expectation[5] = expectation[8] = 1;
     } else if (window.devicePixelRatio >= 1.5) {
         expectation[1] = expectation[6] = expectation[9] = 1;
     }
--- a/testing/web-platform/tests/preload/link-header-preload-nonce.html
+++ b/testing/web-platform/tests/preload/link-header-preload-nonce.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <title>Makes sure that Link headers preload resources with CSP nonce</title>
 <script nonce="abc" src="/resources/testharness.js"></script>
 <script nonce="abc" src="/resources/testharnessreport.js"></script>
 <script nonce="abc" src="/preload/resources/preload_helper.js"></script>
 <body>
 <script nonce="abc">
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (numberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce") == 0 &&
             numberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce") == 1) {
             done();
         }
--- a/testing/web-platform/tests/preload/link-header-preload.html
+++ b/testing/web-platform/tests/preload/link-header-preload.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <title>Makes sure that Link headers preload resources</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/preload/resources/preload_helper.js"></script>
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (numberOfResourceTimingEntries("resources/square.png?link-header-preload") == 1 &&
             numberOfResourceTimingEntries("resources/dummy.js?link-header-preload") == 1 &&
             numberOfResourceTimingEntries("resources/dummy.css?link-header-preload") == 1) {
             done();
--- a/testing/web-platform/tests/preload/onerror-event.html
+++ b/testing/web-platform/tests/preload/onerror-event.html
@@ -23,17 +23,17 @@
 <link rel=preload href="non-existent/test.mp4" as=video onerror="videoFailed = true;">
 <link rel=preload href="non-existent/test.oga" as=audio onerror="audioFailed = true;">
 <link rel=preload href="non-existent/security/captions.vtt" as=track onerror="trackFailed = true;">
 <link rel=preload href="non-existent/dummy.xml?foo" as=foobarxmlthing onerror="gibberishFailed = true;">
 <link rel=preload href="non-existent/dummy.xml?fetch" as=fetch onerror="fetchFailed = true;">
 <link rel=preload href="non-existent/dummy.xml?empty" onerror="emptyFailed = true;">
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (styleFailed && scriptFailed && imageFailed && fontFailed && videoFailed && audioFailed &&
             trackFailed && !gibberishFailed && fetchFailed && !emptyFailed) {
             done();
         }
--- a/testing/web-platform/tests/preload/onload-event.html
+++ b/testing/web-platform/tests/preload/onload-event.html
@@ -23,17 +23,17 @@
 <link rel=preload href="resources/white.mp4" as=video onload="videoLoaded = true;">
 <link rel=preload href="resources/sound_5.oga" as=audio onload="audioLoaded = true;">
 <link rel=preload href="resources/foo.vtt" as=track onload="trackLoaded = true;">
 <link rel=preload href="resources/dummy.xml?foo=bar" as=foobarxmlthing onload="gibberishLoaded = true;" onerror="gibberishErrored = true;">
 <link rel=preload href="resources/dummy.xml?fetch" as=fetch onload="fetchLoaded = true;">
 <link rel=preload href="resources/dummy.xml" onload="noTypeLoaded = true;">
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (styleLoaded && scriptLoaded && imageLoaded && fontLoaded && videoLoaded && audioLoaded &&
             trackLoaded && !gibberishLoaded && !gibberishErrored && fetchLoaded && !noTypeLoaded) {
             done();
         }
--- a/testing/web-platform/tests/preload/preload-with-type.html
+++ b/testing/web-platform/tests/preload/preload-with-type.html
@@ -43,17 +43,17 @@
 <link rel=preload href="/fonts/CanvasTest.ttf" as=font type="font/foobar" crossorigin onload="gibberishLoaded++;">
 <script>
     document.write('<link rel=preload href="' + videoURL + '" as=video type="video/foobar" onload="gibberishLoaded++;">');
     document.write('<link rel=preload href="' + audioURL + '" as=audio type="audio/foobar" onload="gibberishLoaded++;">');
 </script>
 <link rel=preload href="resources/foo.vtt" as=track type="text/foobar" onload="gibberishLoaded++;">
 <body>
 <script>
-    setup({explicit_done: true});
+    setup({single_test: true});
 
     var iterations = 0;
 
     function check_finished() {
         if (styleLoaded && scriptLoaded && imageLoaded && fontLoaded && videoLoaded && audioLoaded &&
             trackLoaded && gibberishLoaded == 0) {
             done();
         }
--- a/testing/web-platform/tests/preload/single-download-late-used-preload.html
+++ b/testing/web-platform/tests/preload/single-download-late-used-preload.html
@@ -1,15 +1,16 @@
 <!DOCTYPE html>
 <title>Ensure preloaded resources are not downloaded again when used</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/preload/resources/preload_helper.js"></script>
 <link rel=preload href="resources/square.png?pipe=trickle(d1)" as=image>
 <script>
+    setup({ single_test: true });
     var link = document.getElementsByTagName("link")[0]
     assert_equals(link.as, "image");
     link.addEventListener("load", () => {
         verifyPreloadAndRTSupport();
         verifyNumberOfResourceTimingEntries("resources/square.png?pipe=trickle(d1)", 1);
         var img = document.createElement("img");
         img.src = "resources/square.png?pipe=trickle(d1)";
         img.onload = () => {