Make the reftest framework draw the caret (non-blinking). b=519361 r=roc
authorMats Palmgren <matspal@gmail.com>
Fri, 16 Oct 2009 12:55:49 +0200
changeset 33906 9603902c1e8f4687037292e1f5f421c4944342c4
parent 33905 53f1a647625c8831e4482033dc47b0de4b9c8901
child 33907 aa9d34b1ac9aa5dbab8cbe9ceff7fac8869c7c98
push id9761
push usermpalmgren@mozilla.com
push dateFri, 16 Oct 2009 10:55:56 +0000
treeherdermozilla-central@9603902c1e8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs519361
milestone1.9.3a1pre
Make the reftest framework draw the caret (non-blinking). b=519361 r=roc
layout/tools/reftest/reftest.js
layout/tools/reftest/runreftest.py
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -846,17 +846,18 @@ function InitCurrentCanvasWithSnapshot()
     ctx.save();
     // drawWindow always draws one canvas pixel for each CSS pixel in the source
     // window, so scale the drawing to show the zoom (making each canvas pixel be one
     // device pixel instead)
     ctx.scale(scale, scale);
     ctx.drawWindow(win, win.scrollX, win.scrollY,
                    Math.ceil(gCurrentCanvas.width / scale),
                    Math.ceil(gCurrentCanvas.height / scale),
-                   "rgb(255,255,255)");
+                   "rgb(255,255,255)",
+                   ctx.DRAWWINDOW_DRAW_CARET);
     ctx.restore();
 }
 
 function roundTo(x, fraction)
 {
     return Math.round(x/fraction)*fraction;
 }
 
@@ -875,17 +876,18 @@ function UpdateCurrentCanvasForEvent(eve
         var right = Math.ceil(roundTo(r.right*scale, 0.001))/scale;
         var bottom = Math.ceil(roundTo(r.bottom*scale, 0.001))/scale;
 
         ctx.save();
         ctx.scale(scale, scale);
         ctx.translate(left, top);
         ctx.drawWindow(win, left + win.scrollX, top + win.scrollY,
                        right - left, bottom - top,
-                       "rgb(255,255,255)");
+                       "rgb(255,255,255)",
+                       ctx.DRAWWINDOW_DRAW_CARET);
         ctx.restore();
     }
 }
 
 function DocumentLoaded()
 {
     // Keep track of which test was slowest, and how long it took.
     var currentTestRunTime = Date.now() - gCurrentTestStartTime;
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -59,16 +59,17 @@ def getFullPath(path):
 def createReftestProfile(options, profileDir):
   "Sets up a profile for reftest."
 
   # Set preferences.
   prefsFile = open(os.path.join(profileDir, "user.js"), "w")
   prefsFile.write("""user_pref("browser.dom.window.dump.enabled", true);
 """)
   prefsFile.write('user_pref("reftest.timeout", %d);' % options.timeout)
+  prefsFile.write('user_pref("ui.caretBlinkTime", -1);')
   prefsFile.close()
 
   # install the reftest extension bits into the profile
   profileExtensionsPath = os.path.join(profileDir, "extensions")
   os.mkdir(profileExtensionsPath)
   reftestExtensionPath = os.path.join(SCRIPT_DIRECTORY, "reftest")
   extFile = open(os.path.join(profileExtensionsPath, "reftest@mozilla.org"), "w")
   extFile.write(reftestExtensionPath)