testing/mochitest/tests/test_bug362788.xhtml
author Vicamo Yang <vyang@mozilla.com>
Fri, 08 Mar 2013 00:12:44 +0800
changeset 124114 23d5f8aff7c5c38ac9f59cc86d353a81aed45bf1
parent 74313 f1c41350c548e5f64d206e7559a28d251ddaefff
child 148982 356ba083bb5f8f5e6f76d69d2f5109d37b709039
permissions -rw-r--r--
Bug 833291 - Part 4/7: fix deleteMessage(). r=hsinyi

<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>