toolkit/components/url-classifier/tests/mochitest/classifierFrame.html

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 <html>
     2 <head>
     3 <title></title>
     5 <script type="text/javascript">
     7 var scriptItem = "untouched";
     9 function checkLoads() {
    10   // Make sure the javascript did not load.
    11   window.parent.is(scriptItem, "untouched", "Should not load bad javascript");
    13   // Make sure the css did not load.
    14   var elt = document.getElementById("styleCheck");
    15   var style = document.defaultView.getComputedStyle(elt, "");
    16   window.parent.isnot(style.visibility, "hidden", "Should not load bad css");
    18   // End (parent) test.
    19   window.parent.SimpleTest.finish();
    20 }
    22 </script>
    24 <!-- Try loading from a malware javascript URI -->
    25 <script type="text/javascript" src="http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js"></script>
    27 <!-- Try loading from a malware css URI -->
    28 <link rel="stylesheet" type="text/css" href="http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
    30 <!-- XXX How is this part of the test supposed to work (= be checked)? -->
    31 <!-- Try loading a marked-as-malware css through an @import from a clean URI -->
    32 <link rel="stylesheet" type="text/css" href="import.css"></link>
    33 </head>
    35 <body onload="checkLoads()">
    36 The following should not be hidden:
    37 <div id="styleCheck">STYLE TEST</div>
    38 </body>
    39 </html>

mercurial