forked from mirrors/gecko-dev
Bug 1817567 [wpt PR 38581] - URL: correct location.href failure tests, a=testonly
Automatic update from web-platform-tests URL: correct location.href failure tests Tests depended on results of prior tests and the tested exception was incorrect per the HTML Standard. -- wpt-commits: 5ff3ad864bcf03509806e1feeb3bc208f9ffae1f wpt-pr: 38581
This commit is contained in:
parent
ca1b92e473
commit
a3ca8f5af6
1 changed files with 5 additions and 4 deletions
|
|
@ -5,7 +5,6 @@
|
||||||
<script src=/resources/testharness.js></script>
|
<script src=/resources/testharness.js></script>
|
||||||
<script src=/resources/testharnessreport.js></script>
|
<script src=/resources/testharnessreport.js></script>
|
||||||
<div id=log></div>
|
<div id=log></div>
|
||||||
<iframe></iframe>
|
|
||||||
<script>
|
<script>
|
||||||
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runTests), "Loading data…")
|
promise_test(() => fetch("resources/urltestdata.json").then(res => res.json()).then(runTests), "Loading data…")
|
||||||
|
|
||||||
|
|
@ -41,9 +40,11 @@ function runTests(testData) {
|
||||||
assert_throws_js(TypeError, () => self.navigator.sendBeacon(test.input))
|
assert_throws_js(TypeError, () => self.navigator.sendBeacon(test.input))
|
||||||
}, "sendBeacon(): " + name)
|
}, "sendBeacon(): " + name)
|
||||||
|
|
||||||
self.test(() => {
|
self.test(t => {
|
||||||
assert_throws_js(self[0].TypeError, () => self[0].location = test.input)
|
const frame = document.body.appendChild(document.createElement("iframe"));
|
||||||
}, "Location's href: " + name)
|
t.add_cleanup(() => frame.remove());
|
||||||
|
assert_throws_dom("SyntaxError", frame.contentWindow.DOMException, () => frame.contentWindow.location = test.input);
|
||||||
|
}, "Location's href: " + name);
|
||||||
|
|
||||||
self.test(() => {
|
self.test(() => {
|
||||||
assert_throws_dom("SyntaxError", () => self.open(test.input).close())
|
assert_throws_dom("SyntaxError", () => self.open(test.input).close())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue