testing/mochitest/tests/test_bug362788.xhtml
author Alon Zakai <azakai>
Tue, 10 Aug 2010 14:47:00 -0400
changeset 56142 b2cb926d1ea145b44a08a4558aa147371334b597
parent 1 9b2a99adc05e53cd4010de512f50118594756650
child 75085 f1c41350c548e5f64d206e7559a28d251ddaefff
permissions -rw-r--r--
Bug 536289 - Part 2: Make FTP work for fennec. r=jduell a=blocking-fennec

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