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

branch
TOR_BUG_9701
changeset 14
925c144e1f1f
equal deleted inserted replaced
-1:000000000000 0:cd9792ab3f5d
1 <html>
2 <head>
3 <title></title>
4
5 <script type="text/javascript">
6
7 var scriptItem = "untouched";
8
9 function checkLoads() {
10 // Make sure the javascript did not load.
11 window.parent.is(scriptItem, "untouched", "Should not load bad javascript");
12
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");
17
18 // End (parent) test.
19 window.parent.SimpleTest.finish();
20 }
21
22 </script>
23
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>
26
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>
29
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>
34
35 <body onload="checkLoads()">
36 The following should not be hidden:
37 <div id="styleCheck">STYLE TEST</div>
38 </body>
39 </html>

mercurial