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=696301 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <meta charset="utf-8"> |
michael@0 | 8 | <title>Test for Bug 696301</title> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=696301">Mozilla Bug 696301</a> |
michael@0 | 14 | <p id="display"></p> |
michael@0 | 15 | <div id="content" style="display: none"> |
michael@0 | 16 | |
michael@0 | 17 | </div> |
michael@0 | 18 | <pre id="test"> |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | var errorFired = false; |
michael@0 | 21 | var global = ""; |
michael@0 | 22 | window.onerror = function(message, uri, line) { |
michael@0 | 23 | is(message, "Script error.", "Should have empty error message"); |
michael@0 | 24 | is(uri, |
michael@0 | 25 | "http://example.com/tests/content/base/test/bug696301-script-1.js", |
michael@0 | 26 | "Should have correct script URI"); |
michael@0 | 27 | is(line, 0, "Shouldn't have a line here"); |
michael@0 | 28 | errorFired = true; |
michael@0 | 29 | } |
michael@0 | 30 | </script> |
michael@0 | 31 | <script src="http://example.com/tests/content/base/test/bug696301-script-1.js"></script> |
michael@0 | 32 | <script> |
michael@0 | 33 | is(errorFired, true, "Should have error in different origin script"); |
michael@0 | 34 | is(global, "ran", "Different origin script should have run"); |
michael@0 | 35 | </script> |
michael@0 | 36 | |
michael@0 | 37 | <script type="application/javascript"> |
michael@0 | 38 | errorFired = false; |
michael@0 | 39 | global = ""; |
michael@0 | 40 | window.onerror = function(message, uri, line) { |
michael@0 | 41 | is(message, "ReferenceError: c is not defined", "Should have correct error message"); |
michael@0 | 42 | is(uri, |
michael@0 | 43 | "http://example.com/tests/content/base/test/bug696301-script-1.js", |
michael@0 | 44 | "Should also have correct script URI"); |
michael@0 | 45 | is(line, 3, "Should have a line here"); |
michael@0 | 46 | errorFired = true; |
michael@0 | 47 | } |
michael@0 | 48 | </script> |
michael@0 | 49 | <script src="http://example.com/tests/content/base/test/bug696301-script-1.js" |
michael@0 | 50 | crossorigin></script> |
michael@0 | 51 | <script> |
michael@0 | 52 | is(errorFired, true, "Should have error in different origin script with CORS"); |
michael@0 | 53 | is(global, "ran", "Different origin script with CORS should have run"); |
michael@0 | 54 | </script> |
michael@0 | 55 | |
michael@0 | 56 | <script type="application/javascript"> |
michael@0 | 57 | errorFired = false; |
michael@0 | 58 | global = ""; |
michael@0 | 59 | window.addEventListener("error", function(e) { |
michael@0 | 60 | is(Object.getPrototypeOf(e), Event.prototype, |
michael@0 | 61 | "Object prototype should be Event"); |
michael@0 | 62 | var externalScripts = document.querySelectorAll("script[src]"); |
michael@0 | 63 | is(e.target, externalScripts[externalScripts.length - 1], |
michael@0 | 64 | "Event's target should be the right <script>"); |
michael@0 | 65 | errorFired = true; |
michael@0 | 66 | }, true); |
michael@0 | 67 | </script> |
michael@0 | 68 | <script src="http://example.com/tests/content/base/test/bug696301-script-2.js" |
michael@0 | 69 | crossorigin></script> |
michael@0 | 70 | <script> |
michael@0 | 71 | is(errorFired, true, |
michael@0 | 72 | "Should have error when different origin script fails CORS check"); |
michael@0 | 73 | is(global, "", "Different origin script that fails CORS should not have run"); |
michael@0 | 74 | </script> |
michael@0 | 75 | |
michael@0 | 76 | </pre> |
michael@0 | 77 | </body> |
michael@0 | 78 | </html> |