Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=380418 --> |
michael@0 | 4 | <head> |
michael@0 | 5 | <title>Test for Bug 380418</title> |
michael@0 | 6 | <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 8 | </head> |
michael@0 | 9 | <body> |
michael@0 | 10 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=380418">Mozilla Bug 380418</a> |
michael@0 | 11 | <p id="display"></p> |
michael@0 | 12 | <div id="content" style="display: none"> |
michael@0 | 13 | |
michael@0 | 14 | </div> |
michael@0 | 15 | <pre id="test"> |
michael@0 | 16 | <script class="testbody" type="text/javascript"> |
michael@0 | 17 | |
michael@0 | 18 | var xhrPath = "http://mochi.test:8888" + |
michael@0 | 19 | window.location.pathname.substring("/content".length); |
michael@0 | 20 | |
michael@0 | 21 | var request = new XMLHttpRequest(); |
michael@0 | 22 | request.open("GET", xhrPath, false); |
michael@0 | 23 | request.send(null); |
michael@0 | 24 | |
michael@0 | 25 | // Try reading headers in privileged context |
michael@0 | 26 | is(request.getResponseHeader("Set-Cookie"), "test", "Reading Set-Cookie response header in privileged context"); |
michael@0 | 27 | is(request.getResponseHeader("Set-Cookie2"), "test2", "Reading Set-Cookie2 response header in privileged context"); |
michael@0 | 28 | is(request.getResponseHeader("X-Dummy"), "test", "Reading X-Dummy response header in privileged context"); |
michael@0 | 29 | |
michael@0 | 30 | ok(/\bSet-Cookie:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie in all response headers in privileged context"); |
michael@0 | 31 | ok(/\bSet-Cookie2:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie2 in all response headers in privileged context"); |
michael@0 | 32 | ok(/\bX-Dummy:/i.test(request.getAllResponseHeaders()), "Looking for X-Dummy in all response headers in privileged context"); |
michael@0 | 33 | |
michael@0 | 34 | </script> |
michael@0 | 35 | </pre> |
michael@0 | 36 | </body> |
michael@0 | 37 | </html> |