testing/mochitest/tests/Harness_sanity/test_bug362788.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mochitest/tests/Harness_sanity/test_bug362788.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=362788
     1.7 +-->
     1.8 +<head>
     1.9 +  <title>Test for Bug 362788</title>
    1.10 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
    1.11 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.12 +</head>
    1.13 +<body>
    1.14 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=362788">Mozilla Bug 362788</a>
    1.15 +<p id="display"></p>
    1.16 +<div id="content" style="display: none">
    1.17 +  
    1.18 +</div>
    1.19 +<pre id="test">
    1.20 +<script class="testbody" type="text/javascript">
    1.21 +<![CDATA[
    1.22 +
    1.23 +/** Test for Bug 362788 **/
    1.24 +var Cc = SpecialPowers.Cc;
    1.25 +var Ci = SpecialPowers.Ci;
    1.26 +var lib = Cc["@mozilla.org/url-classifier/jslib;1"]
    1.27 +          .getService().wrappedJSObject;
    1.28 +ok(!!lib, "unable to get wrapped js object");
    1.29 +
    1.30 +
    1.31 +// Make sure we strip off the query params from the key url.
    1.32 +var tests = [
    1.33 +  [ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0&",
    1.34 +    "https://sb-ssl.google.com/safebrowsing/getkey" ],
    1.35 +  [ "https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0.0.1&",
    1.36 +    "https://sb-ssl.google.com/safebrowsing/getkey" ],
    1.37 +
    1.38 +  // The lack of a ? shouldn't make us explode.
    1.39 +  [ "https://sb-ssl.google.com/safebrowsing/getkey",
    1.40 +    "https://sb-ssl.google.com/safebrowsing/getkey" ]
    1.41 +];
    1.42 +
    1.43 +for (var i = 0, testCase = null; testCase = tests[i]; ++i) {
    1.44 +  var url = lib.PROT_UrlCryptoKeyManager.prototype.getPrefName_(testCase[0]);
    1.45 +  ok(url == testCase[1], "unexpected url: " + url);
    1.46 +}
    1.47 +
    1.48 +]]>
    1.49 +</script>
    1.50 +</pre>
    1.51 +</body>
    1.52 +</html>

mercurial