Closed Bug 1268981 Opened 9 years ago Closed 9 years ago

Keep bfcache alive during session store form data test

Categories

(Firefox for Android Graveyard :: Testing, defect)

All
Android
defect
Not set
normal

Tracking

(firefox49 fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 --- fixed

People

(Reporter: JanH, Assigned: JanH)

References

Details

Attachments

(1 file)

The session store form data navigation test (https://dxr.mozilla.org/mozilla-central/source/mobile/android/tests/browser/chrome/test_session_form_data.html#195) only works when the bfcache is active, otherwise the inner value is not restored after going back. As a memory pressure event will disable the bfcache for the current session, we need to make sure that the bfcache is alive while that test is running.
Without the bfcache, the inner value will not be restored after a page navigation, therefore we need to make sure that the bfcache isn't disabled by a stray memory pressure event before or during the test. Review commit: https://reviewboard.mozilla.org/r/49901/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/49901/
Attachment #8747460 - Flags: review?(margaret.leibovic)
Has this actually caused problems in practice? I'm wary to take speculative changes if we haven't experienced a problem.
Flags: needinfo?(jh+bugzilla)
Since you're asking, apparently yes :-), see bug 1270335. Plus some instances of this will have been masked by bug 1268177 - with that one fixed, the test will always keep going (unless we're OOM killed) until it hits the form data test which won't work without the bfcache.
Blocks: 1270335
Flags: needinfo?(jh+bugzilla)
Comment on attachment 8747460 [details] MozReview Request: Bug 1268981 - Make sure the bfcache is enabled during the mobile session store form data test. r=margaret https://reviewboard.mozilla.org/r/49901/#review47757 Well then! I have no problem landing this if it fixes a real problem. r+ with comments addressed. ::: mobile/android/tests/browser/chrome/test_session_form_data.html:253 (Diff revision 1) > // Remove the tab. > gBrowserApp.closeTab(gBrowserApp.getTabForBrowser(browser)); > + > + // Remove the bfcache memory pressure protection. > + Services.prefs.setIntPref("browser.sessionhistory.max_total_viewers", oldMaxTotalViewers); > + Services.prefs.setBoolPref("browser.sessionhistory.bfcacheIgnoreMemoryPressure", false); Instead of remembering the old value, you should be able to just call `Services.prefs.clearUserPref` for both of these pref values. It's confusing that the word "user" is in that method name, but really it just means "clear any pref value that was set while the app was running, restoring it to the default value". You should also do this in a cleanup function that you register, e.g.: http://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/browser/chrome/test_debugger_server.html?force=1#31
Attachment #8747460 - Flags: review?(margaret.leibovic) → review+
Comment on attachment 8747460 [details] MozReview Request: Bug 1268981 - Make sure the bfcache is enabled during the mobile session store form data test. r=margaret Review request updated; see interdiff: https://reviewboard.mozilla.org/r/49901/diff/1-2/
https://reviewboard.mozilla.org/r/49901/#review47757 > Instead of remembering the old value, you should be able to just call `Services.prefs.clearUserPref` for both of these pref values. > > It's confusing that the word "user" is in that method name, but really it just means "clear any pref value that was set while the app was running, restoring it to the default value". > > You should also do this in a cleanup function that you register, e.g.: > http://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/browser/chrome/test_debugger_server.html?force=1#31 Changed it. Since the memory observers changes the default value for the current session, I still need to explicitly set "max_history_viewers" to 1 at the beginning.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: