Title: [251481] trunk/LayoutTests
Revision
251481
Author
cdu...@apple.com
Date
2019-10-23 11:23:28 -0700 (Wed, 23 Oct 2019)

Log Message

Resync imported/w3c/web-platform-tests/html/webappapis WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=203298

Reviewed by Youenn Fablet.

Resync imported/w3c/web-platform-tests/html/webappapis WPT tests from upstream 32ffb13f7f7fce355bf.

* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window-expected.txt:
* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js:
(async_test.t.window.handlers.afterOpen.t.step_func_done):
(async_test.t.window.handlers.afterOpenAsync.t.step_func_done):
* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open-expected.txt: Added.
* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html: Added.
* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/w3c-import.log:
* web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/disallow-crossorigin.html:
* web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py:
(main):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-10-23 18:23:28 UTC (rev 251481)
@@ -1,3 +1,25 @@
+2019-10-23  Chris Dumez  <cdu...@apple.com>
+
+        Resync imported/w3c/web-platform-tests/html/webappapis WPT tests from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=203298
+
+        Reviewed by Youenn Fablet.
+
+        Resync imported/w3c/web-platform-tests/html/webappapis WPT tests from upstream 32ffb13f7f7fce355bf.
+
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window-expected.txt:
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js:
+        (async_test.t.window.handlers.afterOpen.t.step_func_done):
+        (async_test.t.window.handlers.afterOpenAsync.t.step_func_done):
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open-expected.txt: Added.
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html: Added.
+        * web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/w3c-import.log:
+        * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker-expected.txt: Added.
+        * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html: Added.
+        * web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/disallow-crossorigin.html:
+        * web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py:
+        (main):
+
 2019-10-22  Simon Fraser  <simon.fra...@apple.com>
 
         wpt/css/css-images/gradient/color-stops-parsing.html fails

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window-expected.txt (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window-expected.txt	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window-expected.txt	2019-10-23 18:23:28 UTC (rev 251481)
@@ -1,4 +1,4 @@
 
-PASS document.open() after parser is aborted 
-PASS async document.open() after parser is aborted 
+FAIL document.open() after parser is aborted assert_false: child document should not be empty expected false got true
+FAIL async document.open() after parser is aborted assert_false: child document should not be empty expected false got true
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js	2019-10-23 18:23:28 UTC (rev 251481)
@@ -1,28 +1,31 @@
-// document.open() bails out early if there is an **active parser** with
-// non-zero script nesting level. window.stop() aborts the current parser and
-// makes it no longer active, and should allow document.open() to work.
-// For more details, see https://bugzilla.mozilla.org/show_bug.cgi?id=1475000.
+// document.open() bails out early if there is an active parser with non-zero
+// script nesting level or if a load was aborted while there was an active
+// parser. window.stop() aborts the current parser, so once it has been called
+// while a parser is active, document.open() will no longer do anything to that
+// document,
 
 window.handlers = {};
 
 async_test(t => {
   const frame = document.body.appendChild(document.createElement("iframe"));
+  t.add_cleanup(() => frame.remove());
   frame.src = ""
   window.handlers.afterOpen = t.step_func_done(() => {
     const openCalled = frame.contentDocument.childNodes.length === 0;
-    frame.remove();
-    assert_true(openCalled, "child document should be empty");
+    assert_false(openCalled, "child document should not be empty");
+    assert_equals(frame.contentDocument.querySelector("p").textContent,
+                  "Text", "Should still have our paragraph");
   });
 }, "document.open() after parser is aborted");
 
-// Note: This test should pass even if window.close() is not there, as
-// document.open() is not executed synchronously in an inline script.
 async_test(t => {
   const frame = document.body.appendChild(document.createElement("iframe"));
+  t.add_cleanup(() => frame.remove());
   frame.src = ""
   window.handlers.afterOpenAsync = t.step_func_done(() => {
     const openCalled = frame.contentDocument.childNodes.length === 0;
-    frame.remove();
-    assert_true(openCalled, "child document should be empty");
+    assert_false(openCalled, "child document should not be empty");
+    assert_equals(frame.contentDocument.querySelector("p").textContent,
+                  "Text", "Should still have our paragraph");
   });
 }, "async document.open() after parser is aborted");

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open-expected.txt (0 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open-expected.txt	2019-10-23 18:23:28 UTC (rev 251481)
@@ -0,0 +1,4 @@
+
+
+PASS Location sets should cancel current navigation and prevent later document.open() from doing anything 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html (0 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html	2019-10-23 18:23:28 UTC (rev 251481)
@@ -0,0 +1,31 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src=""
+<script src=""
+<body>
+  <script>
+    var t = async_test("Location sets should cancel current navigation and prevent later document.open() from doing anything");
+
+    var finishTest = t.step_func_done(function() {
+        assert_equals(frames[0].document.body.textContent, "PASS",
+                      "Should not have FAIL in our textContent");
+    });
+
+    t.step(function() {
+        var i = document.createElement("iframe");
+        i.srcdoc = `
+          <script>
+            var blob = new Blob(["PASS"], { type: "text/html" });
+            var url = ""
+            location.href = ""
+            frameElement._onload_ = parent.finishTest;
+            document.open();
+            document.write("FAIL");
+            document.close();
+          <\/script>`;
+        document.body.appendChild(i);
+    });
+
+  </script>
+</body>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/w3c-import.log (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/w3c-import.log	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/w3c-import.log	2019-10-23 18:23:28 UTC (rev 251481)
@@ -54,6 +54,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/history-state.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/history.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js
+/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-events.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/mutation-observer.window.js
 /LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/no-new-global.window.js

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker-expected.txt (0 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker-expected.txt	2019-10-23 18:23:28 UTC (rev 251481)
@@ -0,0 +1,3 @@
+
+FAIL [[CanBlock]] in a ServiceWorkerGlobalScope Can't find variable: SharedArrayBuffer
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html (0 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html	2019-10-23 18:23:28 UTC (rev 251481)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/disallow-crossorigin.html (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/disallow-crossorigin.html	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/disallow-crossorigin.html	2019-10-23 18:23:28 UTC (rev 251481)
@@ -10,21 +10,83 @@
 <script>
 'use strict';
 
+setup({
+  allow_uncaught_exception: true
+});
+
 (function() {
   var resolveLoaded;
   var loadedPromise = new Promise(function(resolve) { resolveLoaded = resolve; });
 
-  async_test(function(t) {
-    addEventListener('unhandledrejection', t.unreached_func('unhandledrejection event should never be triggered'));
-    addEventListener('rejectionhandled', t.unreached_func('rejectionhandled event should never be triggered'));
+  promise_test(function(t) {
+    var unreachedUnhandled = t.unreached_func('unhandledrejection event should never be triggered');
+    var unreachedHandled = t.unreached_func('rejectionhandled event should never be triggered');
 
-    loadedPromise.then(t.step_func(function() {
+    addEventListener('unhandledrejection', unreachedUnhandled);
+    addEventListener('rejectionhandled', unreachedHandled);
+    ensureCleanup(t, unreachedUnhandled, unreachedHandled);
+
+    return loadedPromise.then(t.step_func(function() {
+      return new Promise(function(resolve) {
+        t.step_timeout(function() {
+          resolve();
+        }, 1000);
+      });
+    }));
+  }, 'Promise rejection event should be muted for cross-origin non-CORS script');
+
+  promise_test(function(t) {
+    var unreachedUnhandled = t.unreached_func('unhandledrejection event should never be triggered');
+    var unreachedHandled = t.unreached_func('rejectionhandled event should never be triggered');
+
+    addEventListener('unhandledrejection', unreachedUnhandled);
+    addEventListener('rejectionhandled', unreachedHandled);
+    ensureCleanup(t, unreachedUnhandled, unreachedHandled);
+
+    return new Promise(function(resolve) {
+      handleRejectedPromise(new Promise(function(resolve, reject) { reject(42); }));
       t.step_timeout(function() {
-        t.done();
+        resolve();
       }, 1000);
+    });
+  }, 'Promise rejection should be muted if the rejected promise is handled in cross-origin non-CORS script');
+
+  promise_test(function(t) {
+    var promise = new Promise(function(resolve, reject) { reject(42); });
+    var resolveReceived;
+    var eventPromise = new Promise(function(resolve) { resolveReceived = resolve; });
+    var unhandled = t.step_func(function(e) {
+      if (e.promise === promise) {
+        handleRejectedPromise(promise);
+        resolveReceived();
+      }
+    });
+    var unreachedHandled = t.unreached_func('rejectionhandled event should never be triggered');
+
+    addEventListener('unhandledrejection', unhandled);
+    addEventListener('rejectionhandled', unreachedHandled);
+    ensureCleanup(t, unhandled, unreachedHandled);
+
+    return eventPromise.then(t.step_func(function() {
+      return new Promise(function(resolve) {
+        t.step_timeout(function() {
+          resolve();
+        }, 1000);
+      });
     }));
-  }, 'Promise rejection event should be muted for cross-origin non-CORS script');
+  }, 'Promise rejection should be muted if the rejected promise is handled in unhandledrejection event handler in cross-origin non-CORS script');
 
+  function ensureCleanup(t, unhandled, handled) {
+    t.add_cleanup(function() {
+      if (unhandled) {
+        removeEventListener('unhandledrejection', unhandled);
+      }
+      if (handled) {
+        removeEventListener('rejectionhandled', handled);
+      }
+    });
+  }
+
   var scriptEl = document.createElement('script');
   scriptEl.src = "" + 'support/promise-access-control.py?allow=false';
   scriptEl._onload_ = resolveLoaded;

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py (251480 => 251481)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/support/promise-access-control.py	2019-10-23 18:23:28 UTC (rev 251481)
@@ -5,6 +5,14 @@
     if allow != "false":
         headers.append(("Access-Control-Allow-Origin", "*"))
 
-    body = "new Promise(function(resolve, reject) { reject(42); })"
+    body = """
+    	function handleRejectedPromise(promise) {
+    		promise.catch(() => {});
+    	}
 
+    	(function() {
+    		new Promise(function(resolve, reject) { reject(42); });
+    	})();
+    """
+
     return headers, body

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (251480 => 251481)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-10-23 18:23:28 UTC (rev 251481)
@@ -299,6 +299,7 @@
 imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker.html [ Skip ]
 imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker.html [ Skip ]
 imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html [ Skip ]
 
 # Quota check missing in WK1
 http/tests/IndexedDB/storage-limit.https.html [ Skip ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (251480 => 251481)


--- trunk/LayoutTests/platform/win/TestExpectations	2019-10-23 18:07:55 UTC (rev 251480)
+++ trunk/LayoutTests/platform/win/TestExpectations	2019-10-23 18:23:28 UTC (rev 251481)
@@ -3821,6 +3821,7 @@
 imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy [ Skip ]
 imported/w3c/web-platform-tests/server-timing/service_worker_idl.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-_javascript_-agent-formalism/requires-failure.https.any.serviceworker.html [ Skip ]
 
 # No header filtering for WK1
 http/wpt/loading/redirect-headers.html [ Skip ]
@@ -4491,4 +4492,4 @@
 
 webkit.org/b/202952 http/tests/security/navigate-when-restoring-cached-page.html [ Timeout ]
 
-webkit.org/b/202953 http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html [ Timeout ]
\ No newline at end of file
+webkit.org/b/202953 http/tests/websocket/tests/hybi/non-document-mixed-content-blocked-https-with-embedded-http-with-embedded-https.https.html [ Timeout ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to