Bug 1326189 part 4 - Support caret in test_visited_reftests. r=dholbert
authorXidorn Quan <me@upsuper.org>
Fri, 20 Jan 2017 17:27:18 +1100
changeset 377879 01d692457554faa3a9b5728edd0f8eee27790d10
parent 377878 1adf8249feb259fd77b69667adc7313f2e3d7ab6
child 377880 282c3b26cf63c9de10603dd3c7ddc05bb0fb0682
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1326189
milestone53.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 1326189 part 4 - Support caret in test_visited_reftests. r=dholbert MozReview-Commit-ID: I7zaJw1S4ZC
layout/style/test/test_visited_reftests.html
testing/profiles/prefs_general.js
--- 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