Bug 1326189 part 4 - Support caret in test_visited_reftests. r=dholbert
MozReview-Commit-ID: I7zaJw1S4ZC
--- a/layout/style/test/test_visited_reftests.html
+++ b/layout/style/test/test_visited_reftests.html
@@ -105,16 +105,18 @@ function startIframe(url) {
element.src = "css-visited/" + url;
document.body.appendChild(element);
});
}
async function runTests() {
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("async link coloring");
+ // Set caret to a known size, for tests of :visited caret-color styling
+ await SpecialPowers.pushPrefEnv({'set': [['ui.caretWidth', 16]]});
await startIframe("visited-page.html");
await Promise.all(gTests.map(runTest));
SimpleTest.finish();
}
function passes(equal, shot1, shot2)
{
let [correct] = compareSnapshots(shot1, shot2, equal);
@@ -153,17 +155,17 @@ async function runTest(testLine) {
await waitFor100ms();
let tries;
let testSnapshot;
for (tries = 0; tries < gMaxPassingTries * gTimeoutFactor; ++tries) {
if (needsFocus) {
await SimpleTest.promiseFocus(testWindow, false);
}
- testSnapshot = snapshotWindow(testWindow);
+ testSnapshot = snapshotWindow(testWindow, true);
if (passes(isEqual, testSnapshot, refSnapshot)) {
if (tries > gMaxPassingTries) {
gMaxPassingTries = tries;
}
break;
}
// Links might not have been colored yet. Try again in 100ms.
await waitFor100ms();
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -57,16 +57,18 @@ user_pref("media.gmp-manager.updateEnabl
user_pref("dom.w3c_touch_events.enabled", 1);
user_pref("layout.accessiblecaret.enabled_on_touch", false);
user_pref("dom.webcomponents.enabled", true);
user_pref("dom.webcomponents.customelements.enabled", true);
user_pref("dom.htmlimports.enabled", true);
// Existing tests assume there is no font size inflation.
user_pref("font.size.inflation.emPerLine", 0);
user_pref("font.size.inflation.minTwips", 0);
+// Disable the caret blinking so we get stable snapshot
+user_pref("ui.caretBlinkTime", -1);
// AddonManager tests require that the experiments provider be present.
user_pref("experiments.supported", true);
// Point the manifest at something local so we don't risk it hitting production
// data and installing experiments that may vary over time.
user_pref("experiments.manifest.uri", "http://%(server)s/experiments-dummy/manifest");
// Don't allow background tabs to be zombified, otherwise for tests that