2009-01-28 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jan 2009 22:47:20 +0000 (22:47 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jan 2009 22:47:20 +0000 (22:47 +0000)
        Reviewed by Sam Weinig.

        Added layout tests for how many history items are created during a
        redirect. (Many of these results are expected failures for now.)

        * http/tests/history: Added.
        * http/tests/history/redirect-200-refresh-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-200-refresh-0-seconds.pl: Added.
        * http/tests/history/redirect-200-refresh-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-200-refresh-2-seconds.pl: Added.
        * http/tests/history/redirect-301-expected.txt: Added.
        * http/tests/history/redirect-301.pl: Added.
        * http/tests/history/redirect-302-expected.txt: Added.
        * http/tests/history/redirect-302.pl: Added.
        * http/tests/history/redirect-303-expected.txt: Added.
        * http/tests/history/redirect-303.pl: Added.
        * http/tests/history/redirect-307-expected.txt: Added.
        * http/tests/history/redirect-307.pl: Added.
        * http/tests/history/redirect-js-document-location-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-document-location-0-seconds.html: Added.
        * http/tests/history/redirect-js-document-location-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-document-location-2-seconds.html: Added.
        * http/tests/history/redirect-js-document-location-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-document-location-before-load.html: Added.
        * http/tests/history/redirect-js-location-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-0-seconds.html: Added.
        * http/tests/history/redirect-js-location-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-2-seconds.html: Added.
        * http/tests/history/redirect-js-location-assign-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-assign-0-seconds.html: Added.
        * http/tests/history/redirect-js-location-assign-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-assign-2-seconds.html: Added.
        * http/tests/history/redirect-js-location-assign-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-location-assign-before-load.html: Added.
        * http/tests/history/redirect-js-location-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-location-before-load.html: Added.
        * http/tests/history/redirect-js-location-href-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-href-0-seconds.html: Added.
        * http/tests/history/redirect-js-location-href-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-href-2-seconds.html: Added.
        * http/tests/history/redirect-js-location-href-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-location-href-before-load.html: Added.
        * http/tests/history/redirect-js-location-replace-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-replace-0-seconds.html: Added.
        * http/tests/history/redirect-js-location-replace-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-location-replace-2-seconds.html: Added.
        * http/tests/history/redirect-js-location-replace-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-location-replace-before-load.html: Added.
        * http/tests/history/redirect-meta-refresh-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-meta-refresh-0-seconds.html: Added.
        * http/tests/history/redirect-meta-refresh-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-meta-refresh-2-seconds.html: Added.
        * http/tests/history/resources: Added.
        * http/tests/history/resources/redirect-target.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

48 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/history/redirect-200-refresh-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-200-refresh-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-301-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-301.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-302-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-302.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-303-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-303.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-307-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-307.pl [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-js-document-location-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-document-location-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-document-location-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-document-location-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-document-location-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-assign-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-href-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/resources/redirect-target.html [new file with mode: 0644]

index 8dd8fdb..e79759f 100644 (file)
@@ -1,3 +1,60 @@
+2009-01-28  Geoffrey Garen  <ggaren@apple.com>
+
+        Reviewed by Sam Weinig.
+        
+        Added layout tests for how many history items are created during a
+        redirect. (Many of these results are expected failures for now.)
+
+        * http/tests/history: Added.
+        * http/tests/history/redirect-200-refresh-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-200-refresh-0-seconds.pl: Added.
+        * http/tests/history/redirect-200-refresh-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-200-refresh-2-seconds.pl: Added.
+        * http/tests/history/redirect-301-expected.txt: Added.
+        * http/tests/history/redirect-301.pl: Added.
+        * http/tests/history/redirect-302-expected.txt: Added.
+        * http/tests/history/redirect-302.pl: Added.
+        * http/tests/history/redirect-303-expected.txt: Added.
+        * http/tests/history/redirect-303.pl: Added.
+        * http/tests/history/redirect-307-expected.txt: Added.
+        * http/tests/history/redirect-307.pl: Added.
+        * http/tests/history/redirect-js-document-location-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-document-location-0-seconds.html: Added.
+        * http/tests/history/redirect-js-document-location-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-document-location-2-seconds.html: Added.
+        * http/tests/history/redirect-js-document-location-before-load-expected.txt: Added.
+        * http/tests/history/redirect-js-document-location-before-load.html: Added.
+        * http/tests/history/redirect-js-location-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-0-seconds.html: Added.
+        * http/tests/history/redirect-js-location-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-2-seconds.html: Added.
+        * http/tests/history/redirect-js-location-assign-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-assign-0-seconds.html: Added.
+        * http/tests/history/redirect-js-location-assign-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-assign-2-seconds.html: Added.
+        * http/tests/history/redirect-js-location-assign-before-load-expected.txt: Added.
+        * http/tests/history/redirect-js-location-assign-before-load.html: Added.
+        * http/tests/history/redirect-js-location-before-load-expected.txt: Added.
+        * http/tests/history/redirect-js-location-before-load.html: Added.
+        * http/tests/history/redirect-js-location-href-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-href-0-seconds.html: Added.
+        * http/tests/history/redirect-js-location-href-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-href-2-seconds.html: Added.
+        * http/tests/history/redirect-js-location-href-before-load-expected.txt: Added.
+        * http/tests/history/redirect-js-location-href-before-load.html: Added.
+        * http/tests/history/redirect-js-location-replace-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-replace-0-seconds.html: Added.
+        * http/tests/history/redirect-js-location-replace-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-js-location-replace-2-seconds.html: Added.
+        * http/tests/history/redirect-js-location-replace-before-load-expected.txt: Added.
+        * http/tests/history/redirect-js-location-replace-before-load.html: Added.
+        * http/tests/history/redirect-meta-refresh-0-seconds-expected.txt: Added.
+        * http/tests/history/redirect-meta-refresh-0-seconds.html: Added.
+        * http/tests/history/redirect-meta-refresh-2-seconds-expected.txt: Added.
+        * http/tests/history/redirect-meta-refresh-2-seconds.html: Added.
+        * http/tests/history/resources: Added.
+        * http/tests/history/resources/redirect-target.html: Added.
+
 2009-01-28  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dave Hyatt
diff --git a/LayoutTests/http/tests/history/redirect-200-refresh-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-200-refresh-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl b/LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl
new file mode 100755 (executable)
index 0000000..5d4fedc
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# Script to generate a Refresh header HTTP redirect
+
+print "Status: 200 ok\r\n";
+print "Refresh: 0; url=resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>200 Refresh Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a 200 refresh redirect on a 0 second delay.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-200-refresh-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-200-refresh-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl b/LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl
new file mode 100755 (executable)
index 0000000..da5c831
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# Script to generate a Refresh header HTTP redirect
+
+print "Status: 200 ok\r\n";
+print "Refresh: 2; url=resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>200 Refresh Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a 200 refresh redirect on a 2 second delay.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-301-expected.txt b/LayoutTests/http/tests/history/redirect-301-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-301.pl b/LayoutTests/http/tests/history/redirect-301.pl
new file mode 100755 (executable)
index 0000000..6aaa601
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# Script to generate a 301 HTTP redirect
+
+print "Status: 301 Moved Permanently\r\n";
+print "Location: resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>301 Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a 301 redirect.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-302-expected.txt b/LayoutTests/http/tests/history/redirect-302-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-302.pl b/LayoutTests/http/tests/history/redirect-302.pl
new file mode 100755 (executable)
index 0000000..b4e5497
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# Script to generate a 302 HTTP redirect
+
+print "Status: 302 Moved Temporarily\r\n";
+print "Location: resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>302 Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a 302 redirect.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-303-expected.txt b/LayoutTests/http/tests/history/redirect-303-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-303.pl b/LayoutTests/http/tests/history/redirect-303.pl
new file mode 100755 (executable)
index 0000000..c6c7a26
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+# Script to generate a 303 HTTP redirect
+
+print "Status: 303 See Other\r\n";
+print "Location: resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>303 Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a 303 redirect.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-307-expected.txt b/LayoutTests/http/tests/history/redirect-307-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-307.pl b/LayoutTests/http/tests/history/redirect-307.pl
new file mode 100755 (executable)
index 0000000..e60dab9
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+# Script to generate a 307 HTTP redirect
+
+print "Status: 307 Moved Temporarily\r\n";
+print "Location: resources/redirect-target.html?1\r\n";
+print "Content-type: text/html\r\n";
+print "\r\n";
+
+print <<HERE_DOC_END
+<html>
+<head>
+<title>307 Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+
+<body>This page is a 307 redirect.</body>
+</html>
+HERE_DOC_END
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-document-location-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html b/LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html
new file mode 100644 (file)
index 0000000..dc585c0
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { document.location = "resources/redirect-target.html?1"; }, 0);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-document-location-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-2-seconds.html b/LayoutTests/http/tests/history/redirect-js-document-location-2-seconds.html
new file mode 100644 (file)
index 0000000..7eb60a7
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { document.location = "resources/redirect-target.html?1"; }, 2000);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-before-load-expected.txt b/LayoutTests/http/tests/history/redirect-js-document-location-before-load-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-document-location-before-load.html b/LayoutTests/http/tests/history/redirect-js-document-location-before-load.html
new file mode 100644 (file)
index 0000000..8b69a69
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+document.location = "resources/redirect-target.html?1";
+</script>
+</head>
+
+<body>This page is a JavaScript redirect.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-0-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-0-seconds.html
new file mode 100644 (file)
index 0000000..f7ab092
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location = "resources/redirect-target.html?1"; }, 0);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-2-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-2-seconds.html
new file mode 100644 (file)
index 0000000..d708731
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location = "resources/redirect-target.html?1"; }, 2000);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html
new file mode 100644 (file)
index 0000000..c2a2a36
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.assign("resources/redirect-target.html?1"); }, 0);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds.html
new file mode 100644 (file)
index 0000000..bb4dd53
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.assign("resources/redirect-target.html?1"); }, 2000);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-before-load-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-assign-before-load-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-assign-before-load.html b/LayoutTests/http/tests/history/redirect-js-location-assign-before-load.html
new file mode 100644 (file)
index 0000000..76a5906
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+location.assign("resources/redirect-target.html?1");
+</script>
+</head>
+
+<body>This page is a JavaScript redirect.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-before-load-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-before-load-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-before-load.html b/LayoutTests/http/tests/history/redirect-js-location-before-load.html
new file mode 100644 (file)
index 0000000..d8b0b59
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+location = "resources/redirect-target.html?1";
+</script>
+</head>
+
+<body>This page is a JavaScript redirect.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-href-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html
new file mode 100644 (file)
index 0000000..c97fd9a
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.href = "resources/redirect-target.html?1"; }, 0);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-href-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-2-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-href-2-seconds.html
new file mode 100644 (file)
index 0000000..15e8c6d
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.href = "resources/redirect-target.html?1"; }, 2000);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-before-load-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-href-before-load-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-href-before-load.html b/LayoutTests/http/tests/history/redirect-js-location-href-before-load.html
new file mode 100644 (file)
index 0000000..516da4e
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+location.href = "resources/redirect-target.html?1";
+</script>
+</head>
+
+<body>This page is a JavaScript redirect.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html
new file mode 100644 (file)
index 0000000..01c26cf
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.replace("resources/redirect-target.html?1"); }, 0);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html b/LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html
new file mode 100644 (file)
index 0000000..381ce22
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+setTimeout(function () { location.replace("resources/redirect-target.html?1"); }, 2000);
+</script>
+</head>
+
+<body>This page is a JavaScript redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-before-load-expected.txt b/LayoutTests/http/tests/history/redirect-js-location-replace-before-load-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html b/LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html
new file mode 100644 (file)
index 0000000..11a4dcf
--- /dev/null
@@ -0,0 +1,15 @@
+<html>
+<head>
+<title>JavaScript Redirect</title>
+
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+location.replace("resources/redirect-target.html?1");
+</script>
+</head>
+
+<body>This page is a JavaScript redirect.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds-expected.txt
new file mode 100644 (file)
index 0000000..ae83a8d
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+PASS: History item count should be 1 and is.
+
diff --git a/LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html b/LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html
new file mode 100644 (file)
index 0000000..b2b0ee2
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+<meta http-equiv="Refresh" content="0; url=resources/redirect-target.html?1">
+<title>Meta Refresh Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a meta refresh redirect on a 0 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds-expected.txt b/LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds-expected.txt
new file mode 100644 (file)
index 0000000..a4d02fb
--- /dev/null
@@ -0,0 +1,4 @@
+This page is the target of a redirect.
+
+FAIL: History item count should be 1 but instead is 2.
+
diff --git a/LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html b/LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html
new file mode 100644 (file)
index 0000000..1b7abbf
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+<meta http-equiv="Refresh" content="2; url=resources/redirect-target.html?1">
+<title>Meta Refresh Redirect</title>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.keepWebHistory();
+    layoutTestController.waitUntilDone();
+}
+</script>
+
+<body>This page is a meta refresh redirect on a 2 second delay.</body>
+</html>
diff --git a/LayoutTests/http/tests/history/resources/redirect-target.html b/LayoutTests/http/tests/history/resources/redirect-target.html
new file mode 100644 (file)
index 0000000..addfac0
--- /dev/null
@@ -0,0 +1,38 @@
+<!-- This page accepts a query string specifying how many history items should
+be present once it finishes loading. -->
+
+<html>
+<head>
+<title>Redirect Target</title>
+
+<script>
+function log(s)
+{
+    document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
+}
+
+function testHistoryItemCount()
+{
+    var expected = parseInt(location.search.slice(1));
+    var actual = layoutTestController.webHistoryItemCount + 1; // Add one to include the referring page, which loaded before we started recording history.
+    if (actual === expected)
+        log("PASS: History item count should be " + expected + " and is.");
+    else
+        log("FAIL: History item count should be " + expected + " but instead is " + actual + ".");
+}
+
+window.addEventListener("load", function () {
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        testHistoryItemCount();
+        layoutTestController.notifyDone();
+    }
+}, false);
+</script>
+</head>
+
+<body>
+<p>This page is the target of a redirect.</p>
+<pre id="console"></pre>
+</body>
+</html>