summaryrefslogtreecommitdiff
path: root/docshell
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
commitf71108680b30848e48e0a1f7a6cef7fa37ec46b1 (patch)
tree6837e8112b25b27c6f627629e11032bfcf73deef /docshell
parentdfa7af70ce4cd662add88f5e2a881e1054d91ef2 (diff)
downloaduxp-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.gz
Issue #1118 - Part 6: Fix various tests that are no longer correct.
The behavior change of document.open() requires these tests to be changed to account for the new spec behavior.
Diffstat (limited to 'docshell')
-rw-r--r--docshell/test/navigation/file_bug1379762-2.html43
-rw-r--r--docshell/test/navigation/file_document_write_1.html23
-rw-r--r--docshell/test/navigation/mochitest.ini4
-rw-r--r--docshell/test/navigation/test_sessionhistory.html10
4 files changed, 8 insertions, 72 deletions
diff --git a/docshell/test/navigation/file_bug1379762-2.html b/docshell/test/navigation/file_bug1379762-2.html
deleted file mode 100644
index 86033cb2e8..0000000000
--- a/docshell/test/navigation/file_bug1379762-2.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Bug 1379762</title>
- </head>
- <script type="text/just-data">
- onunload = null; // enable bfcache
- ++opener.testCount;
- onpageshow = function(e) {
- opener.ok(!e.persisted, "Pageshow should not be coming from bfcache " + opener.testCount);
- }
- if (opener.testCount == 1) {
- onload = function () {
- setTimeout(function() {
- document.write(testScript);
- }, 0);
- }
- } else if (opener.testCount == 2) {
- // Do this async, just in case.
- setTimeout(function() {
- history.back();
- }, 0);
- } else if (opener.testCount == 3) {
- // Do this async, just in case.
- setTimeout(function() {
- history.forward();
- }, 0);
- } else if (opener.testCount == 4) {
- onload = function() {
- opener.nextTest();
- window.close();
- }
- }
- </script>
- <script>
- var data = document.querySelector("script[type='text/just-data']").textContent;
- // Store the string that does all out work in a global variable, so we can
- // get at it later.
- var testScript = "<script>" + data + "</" + "script>";
- document.write(testScript);
- </script>
-</html>
diff --git a/docshell/test/navigation/file_document_write_1.html b/docshell/test/navigation/file_document_write_1.html
index e0281f7cdb..169046a9b3 100644
--- a/docshell/test/navigation/file_document_write_1.html
+++ b/docshell/test/navigation/file_document_write_1.html
@@ -1,27 +1,16 @@
<html>
<head>
<script>
- function run() {
+ function start() {
+ var length = history.length;
document.open();
document.write("<h5 id='dynamic'>document.written content</h5>");
document.close();
- window.history.go(-1);
- }
-
- function start() {
- if (++opener.testCount == 1) {
- setTimeout(run, 0);
- }
+ opener.is(history.length, length,
+ "document.open/close should not change history");
+ opener.nextTest();
+ window.close();
}
-
- window.addEventListener("pageshow",
- function() {
- ++opener.file_document_write_1_loadCount;
- if (opener.file_document_write_1_loadCount == 2) {
- opener.setTimeout("isTestDynamic()", 0);
- }
- opener.ok(opener.file_document_write_1_loadCount <= 2);
- });
</script>
</head>
<body onload="start();">
diff --git a/docshell/test/navigation/mochitest.ini b/docshell/test/navigation/mochitest.ini
index 8cff81ad13..e2ee307e46 100644
--- a/docshell/test/navigation/mochitest.ini
+++ b/docshell/test/navigation/mochitest.ini
@@ -58,8 +58,8 @@ skip-if = (toolkit == 'android') || (!debug && (os == 'mac' || os == 'win')) # B
[test_reserved.html]
skip-if = (toolkit == 'android') || (debug && e10s) #too slow on Android 4.3 aws only; bug 1030403; bug 1263213 for debug e10s
[test_sessionhistory.html]
-skip-if = toolkit == 'android' #RANDOM
-support-files = file_bug1379762-1.html file_bug1379762-2.html
+skip-if = toolkit == 'android' #RANDOM on Android
+support-files = file_bug1379762-1.html
[test_sibling-matching-parent.html]
[test_sibling-off-domain.html]
[test_triggeringprincipal_frame_nav.html]
diff --git a/docshell/test/navigation/test_sessionhistory.html b/docshell/test/navigation/test_sessionhistory.html
index 10b0cbcafe..e5978acfa4 100644
--- a/docshell/test/navigation/test_sessionhistory.html
+++ b/docshell/test/navigation/test_sessionhistory.html
@@ -33,7 +33,6 @@ var testFiles =
"file_scrollRestoration.html",
"file_bug1300461.html",
"file_bug1379762-1.html",
- "file_bug1379762-2.html",
];
var testCount = 0; // Used by the test files.
@@ -51,15 +50,6 @@ function nextTest_() {
}
}
-// Needed by file_document_write_1.html
-window.file_document_write_1_loadCount = 0;
-function isTestDynamic() {
- var dyn = testWindow.document.getElementById("dynamic");
- is(dyn, null, "Should have gone back to the static page!");
- nextTest();
- testWindow.close();
-}
-
function nextTest() {
setTimeout(nextTest_, 0);
}