зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
251a6dfaf4
Коммит
65554b944c
|
@ -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.
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче