Commit 7226adeb authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Use promise_rejects in portals-activate-no-browsing-context.html.

Change-Id: Iccdbbe823d3d4ed2554c2527d90da8b7692a2e4e
Reviewed-on: https://chromium-review.googlesource.com/c/1450282
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: default avatarAdithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628489}
parent 95759aa3
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script> <script>
promise_test(async () => { promise_test(async t => {
let activatePromise = document.createElement('portal').activate(); let activatePromise = document.createElement('portal').activate();
await activatePromise.then(() => assert_unreached(), e => { await promise_rejects(t, 'InvalidStateError', activatePromise);
assert_true(e instanceof DOMException);
assert_equals(e.name, 'InvalidStateError');
});
}, "A portal with nothing in it cannot be activated"); }, "A portal with nothing in it cannot be activated");
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment