content/base/test/test_bug696301-2.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

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 <!-- Test SVG script here -->
michael@0 20 <svg>
michael@0 21 <script type="application/javascript">
michael@0 22 var errorFired = false;
michael@0 23 var global = "";
michael@0 24 window.onerror = function(message, uri, line) {
michael@0 25 is(message, "Script error.", "Should have empty error message");
michael@0 26 is(uri,
michael@0 27 "http://example.com/tests/content/base/test/bug696301-script-1.js",
michael@0 28 "Should have correct script URI");
michael@0 29 is(line, 0, "Shouldn't have a line here");
michael@0 30 errorFired = true;
michael@0 31 }
michael@0 32 </script>
michael@0 33 <script xlink:href="http://example.com/tests/content/base/test/bug696301-script-1.js"></script>
michael@0 34 <script>
michael@0 35 is(errorFired, true, "Should have error in different origin script");
michael@0 36 is(global, "ran", "Different origin script should have run");
michael@0 37 </script>
michael@0 38
michael@0 39 <script type="application/javascript">
michael@0 40 errorFired = false;
michael@0 41 global = "";
michael@0 42 window.onerror = function(message, uri, line) {
michael@0 43 is(message, "ReferenceError: c is not defined", "Should have correct error message");
michael@0 44 is(uri,
michael@0 45 "http://example.com/tests/content/base/test/bug696301-script-1.js",
michael@0 46 "Should also have correct script URI");
michael@0 47 is(line, 3, "Should have a line here");
michael@0 48 errorFired = true;
michael@0 49 }
michael@0 50 </script>
michael@0 51 <script xlink:href="http://example.com/tests/content/base/test/bug696301-script-1.js"
michael@0 52 crossorigin></script>
michael@0 53 <script>
michael@0 54 is(errorFired, true, "Should have error in different origin script with CORS");
michael@0 55 is(global, "ran", "Different origin script with CORS should have run");
michael@0 56 </script>
michael@0 57
michael@0 58 <script type="application/javascript">
michael@0 59 errorFired = false;
michael@0 60 global = "";
michael@0 61 window.addEventListener("error", function(e) {
michael@0 62 is(Object.getPrototypeOf(e), Event.prototype,
michael@0 63 "Object prototype should be Event");
michael@0 64 var scripts = document.querySelectorAll("script");
michael@0 65 is(e.target, scripts[scripts.length - 1],
michael@0 66 "Event's target should be the right &lt;script>");
michael@0 67 errorFired = true;
michael@0 68 }, true);
michael@0 69 </script>
michael@0 70 <script xlink:href="http://example.com/tests/content/base/test/bug696301-script-2.js"
michael@0 71 crossorigin></script>
michael@0 72 <script>
michael@0 73 is(errorFired, true,
michael@0 74 "Should have error when different origin script fails CORS check");
michael@0 75 is(global, "", "Different origin script that fails CORS should not have run");
michael@0 76 </script>
michael@0 77 </svg>
michael@0 78 </pre>
michael@0 79 </body>
michael@0 80 </html>

mercurial