Bug 1402549 - Part 2 - Use something else to trigger session store activity. r?esawin
Instead of adding and immediately closing a tab, which carries the risk that we
catch a session store file that was written just in-between those two
operations (although part 1 means that we should be able to handle this safely
now), we just reload the current tab.
MozReview-Commit-ID: JbiH8rmbbwJ
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testSessionFilePreservation.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testSessionFilePreservation.java
@@ -1,16 +1,17 @@
package org.mozilla.gecko.tests;
import android.content.Intent;
import android.util.Log;
import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.tests.helpers.GeckoHelper;
+import org.mozilla.gecko.tests.helpers.NavigationHelper;
/**
* Tests session OOM save behavior.
*
* Builds a session on disk, restores it and tests that
* it is then written back to disk correctly.
*/
public class testSessionFilePreservation extends SessionTest {
@@ -40,18 +41,17 @@ public class testSessionFilePreservation
// not accidentally reloading them.
// To make sure we're not simply verifying the very same file we've generated
// and written ourselves further up, we delete it...
deleteProfileFile("sessionstore.js");
// ... and then trigger some session store activity to make sure
// that a fresh session file is written.
- Tab tab = Tabs.getInstance().addTab();
- Tabs.getInstance().closeTab(tab);
+ NavigationHelper.reload();
// Verify sessionstore.js written by Gecko. The session write is delayed
// to batch successive changes, so the file is repeatedly read until it
// matches the expected output. Because of the delay, this part of the
// test takes ~9 seconds to pass.
VerifyJSONCondition verifyJSONCondition = new VerifyJSONCondition(mSession);
boolean success = mSolo.waitForCondition(verifyJSONCondition, SESSION_TIMEOUT);
if (success) {