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