From f594601d765d82178b41365d1d8e225a2eab1054 Mon Sep 17 00:00:00 2001 From: Peter Van der Beken Date: Mon, 19 Apr 2021 12:39:21 +0000 Subject: [PATCH] Bug 1696158 - Move CanSavePresentation to the parent process. Add test. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D110235 --- .../test/navigation/file_blockBFCache.html | 33 +++ docshell/test/navigation/mochitest.ini | 4 + docshell/test/navigation/slow.sjs | 14 ++ .../test/navigation/test_blockBFCache.html | 197 ++++++++++++++++++ 4 files changed, 248 insertions(+) create mode 100644 docshell/test/navigation/file_blockBFCache.html create mode 100644 docshell/test/navigation/slow.sjs create mode 100644 docshell/test/navigation/test_blockBFCache.html diff --git a/docshell/test/navigation/file_blockBFCache.html b/docshell/test/navigation/file_blockBFCache.html new file mode 100644 index 000000000000..dc743cdc673d --- /dev/null +++ b/docshell/test/navigation/file_blockBFCache.html @@ -0,0 +1,33 @@ + diff --git a/docshell/test/navigation/mochitest.ini b/docshell/test/navigation/mochitest.ini index 4d4e1ef5af61..98179ed35749 100644 --- a/docshell/test/navigation/mochitest.ini +++ b/docshell/test/navigation/mochitest.ini @@ -99,6 +99,10 @@ skip-if = (os == "android") # Bug 1560378 [test_bug1375833.html] [test_bug1536471.html] support-files = file_bug1536471.html +[test_blockBFCache.html] +support-files = + file_blockBFCache.html + slow.sjs [test_child.html] [test_docshell_gotoindex.html] support-files = file_docshell_gotoindex.html diff --git a/docshell/test/navigation/slow.sjs b/docshell/test/navigation/slow.sjs new file mode 100644 index 000000000000..89313e0534eb --- /dev/null +++ b/docshell/test/navigation/slow.sjs @@ -0,0 +1,14 @@ +function handleRequest(request, response) +{ + response.processAsync(); + + timer = Components.classes["@mozilla.org/timer;1"]. + createInstance(Components.interfaces.nsITimer); + timer.init(function() { + response.finish(); + }, 5000, Components.interfaces.nsITimer.TYPE_ONE_SHOT); + + response.setStatusLine(null, 200, "OK"); + response.setHeader("Content-Type", "text/plain", false); + response.write("Start of the content."); +} diff --git a/docshell/test/navigation/test_blockBFCache.html b/docshell/test/navigation/test_blockBFCache.html new file mode 100644 index 000000000000..707fd0b96ec7 --- /dev/null +++ b/docshell/test/navigation/test_blockBFCache.html @@ -0,0 +1,197 @@ + + + + + Blocking pages from entering BFCache + + + + + + +