summaryrefslogtreecommitdiffstats
path: root/layout/generic/test/file_bug514732_window.xul
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/generic/test/file_bug514732_window.xul
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/generic/test/file_bug514732_window.xul')
-rw-r--r--layout/generic/test/file_bug514732_window.xul81
1 files changed, 81 insertions, 0 deletions
diff --git a/layout/generic/test/file_bug514732_window.xul b/layout/generic/test/file_bug514732_window.xul
new file mode 100644
index 000000000..37d5e464b
--- /dev/null
+++ b/layout/generic/test/file_bug514732_window.xul
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window id="514732Test"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ width="600"
+ height="600"
+ onload="setTimeout(nextTest,0);"
+ title="bug 514732 test">
+
+ <script type="application/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/docshell_helpers.js">
+ </script>
+
+ <script type="application/javascript"><![CDATA[
+
+ // Define the generator-iterator for the tests.
+ var tests = testIterator();
+
+ ////
+ // Execute the next test in the generator function.
+ //
+ function nextTest() {
+ tests.next();
+ }
+
+ ////
+ // Generator function for test steps for bug 514732. The MozScrolledAreaChanged
+ // should be fired when a page is restored from the bfcache as though it had
+ // reloaded.
+ //
+ function testIterator() {
+ // Make sure bfcache is on.
+ enableBFCache(true);
+
+
+ // Load a wide and tall page, and then another.
+ for (var i = 0; i < 2; ++i) {
+ doPageNavigation( {
+ uri: "data:text/html,<!DOCTYPE html><html>" +
+ "<head><title>bug 514732 bfcache test page " + i + "</title></head>" +
+ "<body>" +
+ '<div style="position: absolute; left: 10000px; top: 10000px; width: 500px; height: 500px;">' +
+ "</body></html>",
+ eventsToListenFor: ["MozScrolledAreaChanged"],
+ expectedEvents: [ { type: "MozScrolledAreaChanged" } ],
+ onNavComplete: nextTest
+ } );
+ yield;
+ }
+
+ // Navigate back to the first page. Don't test for width and height
+ // yet, just make sure we get an event.
+ doPageNavigation( {
+ back: true,
+ eventsToListenFor: ["MozScrolledAreaChanged"],
+ expectedEvents: [ { type: "MozScrolledAreaChanged" } ],
+ onNavComplete: nextTest
+ } );
+ yield;
+
+ // Navigate forth to our wide and tall page, this time testing for
+ // width and height on the event.
+ doPageNavigation( {
+ forward: true,
+ eventsToListenFor: ["MozScrolledAreaChanged"],
+ expectedEvents: [ { type: "MozScrolledAreaChanged" } ],
+ onNavComplete: nextTest
+ } );
+ yield;
+
+ // Tell the framework the test is finished. Include the final 'yield'
+ // statement to prevent a StopIteration exception from being thrown.
+ finish();
+ yield;
+ }
+
+ ]]></script>
+
+ <browser type="content-primary" flex="1" id="content" src="about:blank"/>
+</window>