Bug 1425267 fix url param schema for launchWebAuthFlow, r=rpl

This commit is contained in:
Shane Caraveo 2017-12-21 15:18:26 -08:00
parent b864e4d18d
commit cd4131b5bf
2 changed files with 9 additions and 4 deletions

View File

@ -162,7 +162,7 @@
"name": "details",
"type": "object",
"properties": {
"url": {"type": "string"},
"url": {"$ref": "manifest.HttpURL"},
"interactive": {"type": "boolean", "optional": true}
}
},
@ -185,7 +185,7 @@
"description": "Generates a redirect URL to be used in |launchWebAuthFlow|.",
"parameters": [
{
"name": " path",
"name": "path",
"type": "string",
"default": "",
"optional": true,

View File

@ -77,8 +77,13 @@ add_task(async function test_badAuthURI() {
],
},
async background() {
await browser.test.assertRejects(browser.identity.launchWebAuthFlow({interactive: true, url: "foobar"}),
"details.url is invalid", "invalid param url");
for (let url of ["foobar", "about:addons", "about:blank", "ftp://example.com/test"]) {
await browser.test.assertThrows(
() => { browser.identity.launchWebAuthFlow({interactive: true, url}); },
/Type error for parameter details/,
"details.url is invalid");
}
browser.test.sendMessage("done");
},
});