[tbb-commits] [tor-browser/esr24] Bug 895557 - Add a test for fragment navigation during load. r=nsm, a=lsblakk

mikeperry at torproject.org mikeperry at torproject.org
Fri Aug 29 05:26:38 UTC 2014


commit 9259f4b43af5a48d8c1a891e372e3a3941d37887
Author: Olli Pettay <Olli.Pettay at helsinki.fi>
Date:   Sat Mar 1 20:11:30 2014 +0200

    Bug 895557 - Add a test for fragment navigation during load. r=nsm, a=lsblakk
---
 docshell/test/navigation/Makefile.in               |    1 +
 .../file_fragment_handling_during_load.html        |   24 ++++++++++++++++++++
 docshell/test/navigation/test_sessionhistory.html  |    3 ++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/docshell/test/navigation/Makefile.in b/docshell/test/navigation/Makefile.in
index f8162b9..9d45ed0 100644
--- a/docshell/test/navigation/Makefile.in
+++ b/docshell/test/navigation/Makefile.in
@@ -38,6 +38,7 @@ MOCHITEST_FILES = \
 		file_bug462076_3.html \
 		file_bug508537_1.html \
 		file_document_write_1.html \
+		file_fragment_handling_during_load.html \
 		file_static_and_dynamic_1.html \
 		frame0.html \
 		frame1.html \
diff --git a/docshell/test/navigation/file_fragment_handling_during_load.html b/docshell/test/navigation/file_fragment_handling_during_load.html
new file mode 100644
index 0000000..fbfa0cb
--- /dev/null
+++ b/docshell/test/navigation/file_fragment_handling_during_load.html
@@ -0,0 +1,24 @@
+<html>
+  <head>
+    <script>
+      var timerID = 0;
+      function testDone() {
+        clearTimeout(timerID);
+        var l = document.body.firstChild.contentWindow.location.href;
+        opener.is(l, "data:text/html,bar", "Should have loaded a new document");
+        opener.nextTest();
+        window.close();
+      }
+      function test() {
+        var ifr = document.getElementsByTagName("iframe")[0];
+        ifr.onload = testDone;
+        ifr.contentWindow.location.hash = "b";
+        ifr.contentWindow.location.href = "data:text/html,bar";
+        history.back();
+        timerID = setTimeout(testDone, 2000);
+      }
+    </script>
+  </head>
+  <body onload="setTimeout(test, 0)"><iframe src="data:text/html,foo#a"></iframe>
+  </body>
+</html>
diff --git a/docshell/test/navigation/test_sessionhistory.html b/docshell/test/navigation/test_sessionhistory.html
index a9ee9ec..c33df36 100644
--- a/docshell/test/navigation/test_sessionhistory.html
+++ b/docshell/test/navigation/test_sessionhistory.html
@@ -26,7 +26,8 @@ var testFiles =
     "file_bug508537_1.html",         // Dynamic frames and forward-back
     "file_document_write_1.html",    // Session history + document.write
     "file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
-    "file_bug534178.html"            // Session history transaction clean-up.
+    "file_bug534178.html",           // Session history transaction clean-up.
+    "file_fragment_handling_during_load.html"
   ];
 var testCount = 0; // Used by the test files.
 





More information about the tbb-commits mailing list