|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 <!-- |
|
3 https://bugzilla.mozilla.org/show_bug.cgi?id=362788 |
|
4 --> |
|
5 <head> |
|
6 <title>Test for Bug 362788</title> |
|
7 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
9 </head> |
|
10 <body> |
|
11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=362788">Mozilla Bug 362788</a> |
|
12 <p id="display"></p> |
|
13 <div id="content" style="display: none"> |
|
14 |
|
15 </div> |
|
16 <pre id="test"> |
|
17 <script class="testbody" type="text/javascript"> |
|
18 <![CDATA[ |
|
19 |
|
20 /** Test for Bug 362788 **/ |
|
21 var Cc = SpecialPowers.Cc; |
|
22 var Ci = SpecialPowers.Ci; |
|
23 var lib = Cc["@mozilla.org/url-classifier/jslib;1"] |
|
24 .getService().wrappedJSObject; |
|
25 ok(!!lib, "unable to get wrapped js object"); |
|
26 |
|
27 |
|
28 // Make sure we strip off the query params from the key url. |
|
29 var tests = [ |
|
30 [ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0&", |
|
31 "https://sb-ssl.google.com/safebrowsing/getkey" ], |
|
32 [ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0.0.1&", |
|
33 "https://sb-ssl.google.com/safebrowsing/getkey" ], |
|
34 |
|
35 // The lack of a ? shouldn't make us explode. |
|
36 [ "https://sb-ssl.google.com/safebrowsing/getkey", |
|
37 "https://sb-ssl.google.com/safebrowsing/getkey" ] |
|
38 ]; |
|
39 |
|
40 for (var i = 0, testCase = null; testCase = tests[i]; ++i) { |
|
41 var url = lib.PROT_UrlCryptoKeyManager.prototype.getPrefName_(testCase[0]); |
|
42 ok(url == testCase[1], "unexpected url: " + url); |
|
43 } |
|
44 |
|
45 ]]> |
|
46 </script> |
|
47 </pre> |
|
48 </body> |
|
49 </html> |