Bug 1440565 P2 Add a mochitest that verifies we throw TypeError for fetch() with a view-source URL. r=asuth

This commit is contained in:
Ben Kelly 2018-02-28 10:34:13 -08:00
Родитель 251a6dfaf4
Коммит 65554b944c
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -113,6 +113,14 @@ function testRequestMozErrors() {
});
}
function testViewSourceURL() {
var p2 = fetch('view-source:/').then(function(res) {
ok(false, "view-source: URL should fail");
}, function(e) {
ok(e instanceof TypeError, "view-source: URL should fail");
});
}
function runTest() {
return Promise.resolve()
.then(testAboutURL)
@ -120,5 +128,7 @@ function runTest() {
.then(testSameOriginBlobURL)
.then(testNonGetBlobURL)
.then(testMozErrors)
.then(testRequestMozErrors)
.then(testViewSourceURL)
// Put more promise based tests here.
}