Skip to content
Permalink
Browse files

Move portals web tests into WPT

There's nothing in these tests that is blink specific, so we make them
web platform tests.

Bug: None
Change-Id: I88a17bcfa7e97f890d9331bdd79857e70f6c6ea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1853485
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704771}
  • Loading branch information
kjmcnee authored and chromium-wpt-export-bot committed Oct 10, 2019
1 parent 8048ad3 commit 22944ce46c693c9e6cb95288b166a060cf4d8059
Showing with 32 additions and 0 deletions.
  1. +11 −0 portals/portals-api.html
  2. +21 −0 portals/portals-no-frame-crash.html
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<title>Portals API test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(function() {
assert_true(document.createElement('portal') instanceof HTMLPortalElement);
}, "portal element exists");
</script>
</body>
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
let portal = document.createElement("portal");
let xmlDoc = document.implementation.createDocument("", null);
xmlDoc.appendChild(portal);
}, "inserting a portal element into an XML document shouldn't crash or throw");
test(() => {
let iframe = document.createElement("iframe");
document.body.appendChild(iframe);
let doc = iframe.contentDocument;
iframe.remove();
let portal = document.createElement("portal");
doc.body.appendChild(portal);
}, "inserting a portal element into a detached iframe's document shouldn't crash or throw");
</script>
</body>

0 comments on commit 22944ce

Please sign in to comment.
You can’t perform that action at this time.