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
This commit is contained in:
Anne van Kesteren 2020-05-13 09:49:54 +00:00 коммит произвёл moz-wptsync-bot
Родитель cfeaca2e02
Коммит d8996ddc45
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -59,7 +59,7 @@ test(() => {
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)`);
});
@ -74,14 +74,16 @@ test(() => {
`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 */