Bug 1344486 - Intermittent TEST-UNEXPECTED-PASS | /html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html. fail early if noModule. r=jgraham, a=test-only
authorJoel Maher <jmaher@mozilla.com>
Thu, 06 Apr 2017 07:30:08 -0400
changeset 395726 856ab3a478973d2aa5ff3babdba3734ffdd41e0d
parent 395725 9677396b33eba5950bbde5df8d6a73d35c4c0137
child 395727 8bf7e4280c94804177cc17722786c007df504cb1
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham, test-only
bugs1344486
milestone54.0a2
Bug 1344486 - Intermittent TEST-UNEXPECTED-PASS | /html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html. fail early if noModule. r=jgraham, a=test-only MozReview-Commit-ID: K8qMR6fICXH
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html.ini
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -177722,17 +177722,17 @@
    "12842b6e600ac2fc737718d8a9ba3385ed8b678b",
    "support"
   ],
   "html/semantics/scripting-1/the-script-element/nomodule-reflect.html": [
    "ac2b3c16e9e9263cd4c14de205b63709c14ec2e3",
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html": [
-   "5b4a532b21caa6235bed10a28878c65523a816aa",
+   "6ef870db74ba0dbb6171c74437a78cef4a6f6062",
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/nomodule-set-on-external-module-script.html": [
    "f43755d9dffe2983a377f2c00b855f106776b617",
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/nomodule-set-on-inline-classic-scripts.html": [
    "2b6654342c5a2e2d85df2bc8ec805b5fa7ed1550",
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html.ini
@@ -1,5 +1,6 @@
 [nomodule-set-on-async-classic-script.html]
   type: testharness
+  [An asynchronously loaded classic script with noModule set to false must run]
+    expected: FAIL
   [An asynchronously loaded classic script with noModule set to true must not run]
     expected: FAIL
-
--- a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html
+++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/nomodule-set-on-async-classic-script.html
@@ -6,41 +6,43 @@
 <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <!-- Load this script synchronously to ensure test cases below can load it in 200ms -->
 <script src="resources/set-script-executed.js"></script>
 </head>
 <body>
 <script>
+let supportsNoModule = "noModule" in document.getElementsByTagName("script")[0];
 
 waitForLoadEvent = new Promise((resolve) => {
     window.onload = resolve;
 });
 
 waitForAsyncScript = () => {
     return new Promise((resolve) => {
         waitForLoadEvent.then(() => setTimeout(resolve, 200));
     });
 }
 
-let readyForSecondTest;
 promise_test(() => {
     window.executed = false;
     let loaded = false;
     let errored = false;
 
     let script = document.createElement('script');
+
     script.src = './resources/set-script-executed.js';
     script.onload = () => loaded = true;
     script.onerror = () => errored = true;
     script.noModule = false;
     document.body.appendChild(script);
 
     return waitForAsyncScript().then(() => {
+        assert_true(supportsNoModule);
         assert_true(executed);
         assert_true(loaded);
         assert_false(errored);
     });
 }, 'An asynchronously loaded classic script with noModule set to false must run');
 
 promise_test(() => {
     window.executed = false;
@@ -50,16 +52,17 @@ promise_test(() => {
     let script = document.createElement('script');
     script.src = './resources/set-script-executed.js';
     script.onload = () => loaded = true;
     script.onerror = () => errored = true;
     script.noModule = true;
     document.body.appendChild(script);
 
     return waitForAsyncScript().then(() => {
+        assert_true(supportsNoModule);
         assert_false(executed);
         assert_false(loaded);
         assert_false(errored);
     });
 }, 'An asynchronously loaded classic script with noModule set to true must not run');
 
 </script>
 </body>