|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=973837 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="utf-8"> |
|
8 <title>Tests for Bug 973837</title> |
|
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
11 |
|
12 <script> |
|
13 SimpleTest.waitForExplicitFinish(); |
|
14 |
|
15 const OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent; |
|
16 |
|
17 function runObjectURITest(testCase) { |
|
18 var testObject = document.getElementById("testObject"); |
|
19 testObject.data = testCase.URI; |
|
20 |
|
21 testObject instanceof OBJLC; |
|
22 testObject = SpecialPowers.wrap(testObject); |
|
23 |
|
24 is(testObject.displayedType, OBJLC.TYPE_NULL, testCase.desc + |
|
25 " testObject.displayedType should be TYPE_NULL (4)"); |
|
26 runNextTest(); |
|
27 } |
|
28 |
|
29 var testCaseIndex = -1; |
|
30 testCases = [ |
|
31 { |
|
32 desc: "Test 1: view-source should not be allowed in an object.", |
|
33 URI: "view-source:file_general_document.html" |
|
34 }, |
|
35 { |
|
36 desc: "Test 2: feed:view-source should not be allowed in an object.", |
|
37 URI: "feed:view-source:file_general_document.html" |
|
38 }, |
|
39 { |
|
40 desc: "Test 3: jar:view-source should not be allowed in an object", |
|
41 URI: "jar:view-source:file_general_document.html/!/" |
|
42 }, |
|
43 { |
|
44 desc: "Test 4: pcast:view-source should not be allowed in an object", |
|
45 URI: "pcast:view-source:file_general_document.html" |
|
46 }, |
|
47 { |
|
48 desc: "Test 5: pcast:feed:view-source should not be allowed in an object", |
|
49 URI: "pcast:feed:view-source:file_general_document.html" |
|
50 } |
|
51 ]; |
|
52 |
|
53 function runNextTest() { |
|
54 ++testCaseIndex; |
|
55 if (testCaseIndex == testCases.length) { |
|
56 SimpleTest.finish(); |
|
57 return; |
|
58 } |
|
59 |
|
60 runObjectURITest(testCases[testCaseIndex]); |
|
61 } |
|
62 |
|
63 addLoadEvent(runNextTest); |
|
64 </script> |
|
65 </head> |
|
66 |
|
67 <body> |
|
68 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=973837">Mozilla Bug 973837</a> |
|
69 <p id="display"></p> |
|
70 |
|
71 <object id="testObject"></object> |
|
72 |
|
73 </body> |
|
74 </html> |