Bug 864711 - Simplify test page for browser_pageshow.js to ensure it's put into bfcache; r=yoric
authorTim Taubert <ttaubert@mozilla.com>
Mon, 29 Apr 2013 10:02:45 +0200
changeset 141125 c6aec5b4f47c6074773a86480fada9632681fe89
parent 141124 aeb0f8faf02b159c8261814bf55dc483ceb183bd
child 141126 de84d3b91af369fa32dfbfe165a34bd6c5d81453
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoric
bugs864711
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864711 - Simplify test page for browser_pageshow.js to ensure it's put into bfcache; r=yoric
browser/components/sessionstore/test/browser_pageshow.js
--- a/browser/components/sessionstore/test/browser_pageshow.js
+++ b/browser/components/sessionstore/test/browser_pageshow.js
@@ -10,37 +10,40 @@ function test() {
  * in history) marks the window as dirty and causes data about the tab that
  * changed to be re-collected.
  *
  * We will do this by creating a tab with two history entries and going back
  * to the first. When we now request the current browser state from the
  * session store service the first history entry must be selected.
  */
 
+const URL = "data:text/html,<h1>first</h1>";
+const URL2 = "data:text/html,<h1>second</h1>";
+
 function runTests() {
   // Create a dummy window that is regarded as active. We need to do this
   // because we always collect data for tabs of active windows no matter if
   // the window is dirty or not.
   let win = OpenBrowserWindow();
   yield waitForLoad(win);
 
   // Create a tab with two history entries.
   let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
-  yield loadURI("about:robots");
-  yield loadURI("about:mozilla");
+  yield loadURI(URL);
+  yield loadURI(URL2);
 
   // All windows currently marked as dirty will be written to disk
   // and thus marked clean afterwards.
   yield forceWriteState();
 
   // Go back to 'about:robots' - which is loaded from the bfcache and thus
   // will not fire a 'load' event but a 'pageshow' event with persisted=true.
   waitForPageShow();
   yield gBrowser.selectedBrowser.goBack();
-  is(tab.linkedBrowser.currentURI.spec, "about:robots", "url is about:robots");
+  is(tab.linkedBrowser.currentURI.spec, URL, "correct url after going back");
 
   // If by receiving the 'pageshow' event the first window has correctly
   // been marked as dirty, getBrowserState() should return the tab we created
   // with the right history entry (about:robots) selected.
   let state = JSON.parse(ss.getBrowserState());
   is(state.windows[0].tabs[1].index, 1, "first history entry is selected");
 
   // Clean up after ourselves.