Blame dom/base/test/chrome/test_bug380418.html
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
<html>
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
<head>
|
|
Packit |
f0b94e |
<title>Test for Bug 380418</title>
|
|
Packit |
f0b94e |
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
|
Packit |
f0b94e |
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
Packit |
f0b94e |
</head>
|
|
Packit |
f0b94e |
<body>
|
|
Packit |
f0b94e |
Mozilla Bug 380418
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
<script class="testbody" type="text/javascript">
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
var xhrPath = "http://mochi.test:8888" +
|
|
Packit |
f0b94e |
window.location.pathname.substring("/content".length);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
var request = new XMLHttpRequest();
|
|
Packit |
f0b94e |
request.open("GET", xhrPath, false);
|
|
Packit |
f0b94e |
request.send(null);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
// Try reading headers in privileged context
|
|
Packit |
f0b94e |
is(request.getResponseHeader("Set-Cookie"), "test", "Reading Set-Cookie response header in privileged context");
|
|
Packit |
f0b94e |
is(request.getResponseHeader("Set-Cookie2"), "test2", "Reading Set-Cookie2 response header in privileged context");
|
|
Packit |
f0b94e |
is(request.getResponseHeader("X-Dummy"), "test", "Reading X-Dummy response header in privileged context");
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
ok(/\bSet-Cookie:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie in all response headers in privileged context");
|
|
Packit |
f0b94e |
ok(/\bSet-Cookie2:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie2 in all response headers in privileged context");
|
|
Packit |
f0b94e |
ok(/\bX-Dummy:/i.test(request.getAllResponseHeaders()), "Looking for X-Dummy in all response headers in privileged context");
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
</script>
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
</body>
|
|
Packit |
f0b94e |
</html>
|