Bug 1337940 - Part 3 - Restrict the amount of session history we keep around during test_parse_rule. r?dbaron
During its run this test amasses a considerable collection of session history. Because the page title never changes, though, the Android session store previously never attempted to capture the state here.
As of this bug this has changed and history change events now (correctly) trigger a session store data update on Android as well. On a debug build running on the Android emulator however, collecting the session history data can take up to 1 s when the session history count approaches the default "browser.sessionhistory.max_entries" limit of 50 entries, which increases the total running time of this test considerably and leads to timeouts (although only just).
Bug 1341810 will track possibly improving the session store performance on Android by not doing a full history collect when not needed, but for the time being, restricting the amount of session history we keep around during this test is the simpler solution.
MozReview-Commit-ID: JRREidiWnM3
--- a/layout/style/test/test_parse_rule.html
+++ b/layout/style/test/test_parse_rule.html
@@ -244,13 +244,17 @@ var doTests = function() {
isnot(base, canonical, "Sanity check for rule: " + testset[curTest].base);
}
frame.contentDocument.open();
frame.contentDocument.write("<html lang=en><style>" + testset[curTest].tests[curSubTest] + "</style><div id=a class='a b c' title='zxcv weeqweqeweasd a'></div>");
frame.contentWindow.onload = function(){setTimeout(doTests, 0);};
frame.contentDocument.close();
};
-doTests();
+// Running a debug build on the Android emulator is slooow and collecting
+// all the session history this test amasses through repeated navigations
+// adds considerably to the running time. Therefore, we restrict the
+// amount of session history we keep around during this test.
+SpecialPowers.pushPrefEnv({"set": [['browser.sessionhistory.max_entries', 4]]}, doTests);
};
</script>