bug112564_window.xhtml (2965B)
1 <?xml version="1.0"?> 2 3 <!-- This Source Code Form is subject to the terms of the Mozilla Public 4 - License, v. 2.0. If a copy of the MPL was not distributed with this 5 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 6 7 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 8 9 <window id="112564Test" 10 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 11 width="600" 12 height="600" 13 onload="onLoad();" 14 title="112564 test"> 15 16 <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js" /> 17 <script type="application/javascript" src="docshell_helpers.js" /> 18 <script type="application/javascript"><![CDATA[ 19 var gTestsIterator; 20 21 function onLoad() { 22 gTestsIterator = testsIterator(); 23 nextTest(); 24 } 25 26 function nextTest() { 27 gTestsIterator.next(); 28 } 29 30 function* testsIterator() { 31 // Load a secure page with a no-cache header, followed by a simple page. 32 // no-cache should not interfere with the bfcache in the way no-store 33 // does. 34 var test1DocURI = "https://example.com:443/chrome/docshell/test/chrome/112564_nocache.html"; 35 36 doPageNavigation({ 37 uri: test1DocURI, 38 eventsToListenFor: ["load", "pageshow"], 39 expectedEvents: [ { type: "load", 40 title: "test1" }, 41 { type: "pageshow", 42 title: "test1", 43 persisted: false } ], 44 onNavComplete: nextTest 45 }); 46 yield undefined; 47 48 var test2DocURI = "data:text/html,<html><head><title>test2</title></head>" + 49 "<body>test2</body></html>"; 50 51 doPageNavigation({ 52 uri: test2DocURI, 53 eventsToListenFor: ["load", "pageshow", "pagehide"], 54 expectedEvents: [ { type: "pagehide", 55 title: "test1", 56 persisted: true }, 57 { type: "load", 58 title: "test2" }, 59 { type: "pageshow", 60 title: "test2", 61 persisted: false } ], 62 onNavComplete: nextTest 63 }); 64 yield undefined; 65 66 // Now go back in history. First page has been cached. 67 // Check persisted property to confirm 68 doPageNavigation({ 69 back: true, 70 eventsToListenFor: ["pageshow", "pagehide"], 71 expectedEvents: [ { type: "pagehide", 72 title: "test2", 73 persisted: true }, 74 { type: "pageshow", 75 title: "test1", 76 persisted: true } ], 77 onNavComplete: nextTest 78 }); 79 yield undefined; 80 81 finish(); 82 } 83 ]]></script> 84 85 <browser type="content" primary="true" flex="1" id="content" remote="true" maychangeremoteness="true" /> 86 </window>