зеркало из https://github.com/mozilla/pjs.git
52 строки
1.7 KiB
HTML
52 строки
1.7 KiB
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=362788
|
|
-->
|
|
<head>
|
|
<title>Test for Bug 362788</title>
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=362788">Mozilla Bug 362788</a>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
<pre id="test">
|
|
<script class="testbody" type="text/javascript">
|
|
<![CDATA[
|
|
|
|
/** Test for Bug 362788 **/
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
var Cc = Components.classes;
|
|
var Ci = Components.interfaces;
|
|
var lib = Cc["@mozilla.org/url-classifier/jslib;1"]
|
|
.getService().wrappedJSObject;
|
|
ok(!!lib, "unable to get wrapped js object");
|
|
|
|
|
|
// Make sure we strip off the query params from the key url.
|
|
var tests = [
|
|
[ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0&",
|
|
"https://sb-ssl.google.com/safebrowsing/getkey" ],
|
|
[ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0.0.1&",
|
|
"https://sb-ssl.google.com/safebrowsing/getkey" ],
|
|
|
|
// The lack of a ? shouldn't make us explode.
|
|
[ "https://sb-ssl.google.com/safebrowsing/getkey",
|
|
"https://sb-ssl.google.com/safebrowsing/getkey" ]
|
|
];
|
|
|
|
for (var i = 0, testCase = null; testCase = tests[i]; ++i) {
|
|
var url = lib.PROT_UrlCryptoKeyManager.prototype.getPrefName_(testCase[0]);
|
|
ok(url == testCase[1], "unexpected url: " + url);
|
|
}
|
|
|
|
]]>
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|