aboutsummaryrefslogtreecommitdiff
path: root/www/waterfox/files/patch-bug1425267
blob: 0dcca4ec774b86cdf4a9794af7d9438b0ad0cc26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
commit d60383c31a25
Author: Shane Caraveo <scaraveo@mozilla.com>
Date:   Thu Dec 21 15:18:26 2017 -0800

    Bug 1425267 fix url param schema for launchWebAuthFlow, r=rpl a=gchang
    
    --HG--
    extra : source : 0c4f3b8d311e4751dafc00d689c3bf07f17c15dd
---
 toolkit/components/extensions/schemas/identity.json              | 4 ++--
 .../components/extensions/test/mochitest/test_ext_identity.html  | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git toolkit/components/extensions/schemas/identity.json toolkit/components/extensions/schemas/identity.json
index 308687ce8c83..97b8a57f379c 100644
--- toolkit/components/extensions/schemas/identity.json
+++ toolkit/components/extensions/schemas/identity.json
@@ -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,
diff --git toolkit/components/extensions/test/mochitest/test_chrome_ext_identity.html toolkit/components/extensions/test/mochitest/test_chrome_ext_identity.html
index adf67b6ffe59..278223896749 100644
--- toolkit/components/extensions/test/mochitest/test_chrome_ext_identity.html
+++ toolkit/components/extensions/test/mochitest/test_chrome_ext_identity.html
@@ -78,8 +78,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");
     },
   });