https://github.com/mozilla/gecko-dev
Raw File
Tip revision: c4988db58eb739e510435fd920dcf1299af0c0ba authored by seabld on 22 May 2012, 14:48:27 UTC
Added tag SEAMONKEY_2_9b2_RELEASE for changeset FIREFOX_12_0b3_BUILD1. CLOSED TREE a=release
Tip revision: c4988db
test_bug362788.xhtml
<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="/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>
back to top