Navigation-rewrite: Assert that location.href setter throws SyntaxError DOMException
In the upcoming navigation and session history rewrite [1], we are making the the location.href setter throw a SyntaxError DOMException, instead of the current TypeError (not even DOMException) that it is currently spec'ed to throw.
[1]: https://whatpr.org/html/6315/nav-history-apis.html#dom-location-href
R=domenic@chromium.org
Bug: 1358338
Change-Id: Ic276494204d3660858a4655ae75da5fa5a637988
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3876468
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1045414}
diff --git a/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html b/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html
index 2a11418..f4e4e36 100644
--- a/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html
+++ b/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
-<title>location.href unparseable URL throws a DOM exception</title>
+<title>location.href unparseable URL throws a SyntaxError DOMException</title>
<link rel="help" href="https://html.spec.whatwg.org/#the-location-interface:dom-location-href-2">
<link rel="help" href="https://html.spec.whatwg.org/#following-hyperlinks-2">
<script src="/resources/testharness.js"></script>
@@ -20,10 +20,11 @@
win.onload = resolve;
});
- assert_throws_js(win.TypeError, () => {
+ assert_throws_dom("SyntaxError", win.DOMException, () => {
win.location.href = kUnparseableURL;
- }, "location.href setter throws a TypeError");
-}, "location.href setter throws a TypeError for unparseable URLs");
+ }, "location.href setter throws a SyntaxError DOMException");
+}, "location.href setter throws a SyntaxError DOMException for unparseable " +
+ "URLs");
promise_test(async t => {
const win = window.open("/common/blank.html");