Bug 1636876 [wpt PR 23500] - registerProtocolHandler(): handler's URL cannot be a blob URL, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Wed, 13 May 2020 09:49:54 +0000
changeset 531177 19d2de87b9f8426718f9760277c065f36d59c4d4
parent 531176 8d27c5ce5d6fb6aac7f1d74f47b8c90f697142cc
child 531178 01914594e45f9fbc9393eea3735fd06d5947f524
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1636876, 23500
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1636876 [wpt PR 23500] - registerProtocolHandler(): handler's URL cannot be a blob URL, a=testonly Automatic update from web-platform-tests registerProtocolHandler(): handler's URL cannot be a blob URL For https://github.com/whatwg/html/pull/5530. -- wpt-commits: 409d25002dbeb39de00ba8d023bb6ac85b7dbfe8 wpt-pr: 23500
testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
--- a/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
+++ b/testing/web-platform/tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.https.html
@@ -54,39 +54,41 @@ test(() => {
 ].forEach(url => {
   test(() => {
     assert_throws_dom('SYNTAX_ERR', () => { navigator.registerProtocolHandler('mailto', url, 'foo'); });
     assert_throws_dom('SECURITY_ERR', () => { navigator.registerProtocolHandler('x', url, 'foo'); });
   }, `registerProtocolHandler: Invalid URL "${url}" should throw (but after scheme)`);
 
   test(() => {
     assert_throws_dom('SYNTAX_ERR', () => { navigator.unregisterProtocolHandler('mailto', url); });
-    assert_throws_dom('SECURITY_ERR', () => { navigator.registerProtocolHandler('x', url, 'foo'); });
+    assert_throws_dom('SECURITY_ERR', () => { navigator.unregisterProtocolHandler('x', url, 'foo'); });
   }, `unregisterProtocolHandler: Invalid URL "${url}" should throw (but after scheme)`);
 });
 
 [
   'http://%s.com',
   'http://%s.example.com',
   'http://example.com/%s',
   'https://example.com/%s',
   'http://foobar.example.com/%s',
   'mailto:%s@example.com',
   'mailto:%s',
   `ftp://${location.host}/%s`,
   `chrome://${location.host}/%s`,
   `foo://${location.host}/%s`,
+  URL.createObjectURL(new Blob()) + "#%s",
 ].forEach(url => {
+  const title = url.startsWith("blob:") ? "blob: URL" : url;
   test(() => {
     assert_throws_dom('SECURITY_ERR', () => { navigator.registerProtocolHandler('mailto', url, 'foo'); });
-  }, 'registerProtocolHandler: Invalid URL "' + url + '" should throw SECURITY_ERR.');
+  }, `registerProtocolHandler: Invalid URL "${title}" should throw SECURITY_ERR.`);
 
   test(() => {
     assert_throws_dom('SECURITY_ERR', () => { navigator.unregisterProtocolHandler('mailto', url); });
-  }, 'unregisterProtocolHandler: Invalid URL "' + url + '" should throw SECURITY_ERR.');
+  }, `unregisterProtocolHandler: Invalid URL "${title}" should throw SECURITY_ERR.`);
 });
 
 /* Protocol argument */
 
 /* Overriding any of the following protocols must never be allowed. That would
  * break the browser. */
 [
   'about',