Test changes for bug 458248

git-svn-id: svn://10.0.0.236/trunk@255116 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jonas%sicking.cc
2008-11-19 06:32:19 +00:00
parent f36dd2dd96
commit ad78be4c4b
5 changed files with 35 additions and 1 deletions

View File

@@ -184,6 +184,9 @@ _TEST_FILES = test_bug5141.html \
bug461735-redirect2.sjs \
bug461735-post-redirect.js \
test_bug461735.html \
test_bug458248.html \
file_bug458248.xml \
file_bug458248.xml^headers^ \
$(NULL)
libs:: $(_TEST_FILES)

View File

@@ -0,0 +1 @@
<out>hello</out>

View File

@@ -0,0 +1,2 @@
HTTP 301 Moved Permanently
Location: http://example.com/tests/content/base/test/file_bug458248.xml

View File

@@ -53,7 +53,7 @@ for (i = 0; i < failFiles.length; ++i) {
}
if (!didthrow) {
is(xhr.status, 301, "wrong status");
is(xhr.responseText, "redirect file\n", "wrong response");
is(xhr.responseText, "", "wrong response");
}
else {
ok(1, "should have thrown or given incorrect result");

View File

@@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for Bug 458248</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
xhr = new XMLHttpRequest();
xhr.open('GET', 'file_bug458248.xml', false);
xhr.send(null);
is(xhr.responseXML, null);
is(xhr.responseText, "");
is(xhr.getAllResponseHeaders(), "");
is(xhr.getResponseHeader('Location'), "");
</script>
</pre>
</body>
</html>