From dbb2b3abf39ddb0f114afea62b36d0d0451a0d5f Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Tue, 12 Jul 2011 18:10:10 -0400 Subject: [PATCH] bug 648104 - reftest failures on desktop - can't drawWindow remote content fails r=jmaher, cjones --- layout/tools/reftest/reftest.js | 11 +++++++---- layout/tools/reftest/remotereftest.py | 13 +++++++------ layout/tools/reftest/runreftest.py | 7 +++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index 00eef50801b9..4cfdaa41e4cd 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -65,6 +65,7 @@ const NS_OBSERVER_SERVICE_CONTRACTID = var gLoadTimeout = 0; var gTimeoutHook = null; var gRemote = false; +var gIgnoreWindowSize = false; var gTotalChunks = 0; var gThisChunk = 0; @@ -273,6 +274,7 @@ function InitAndStartRefTests() } } gRemote = prefs.getBoolPref("reftest.remote"); + gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize"); } catch(e) { gLoadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518 @@ -999,10 +1001,11 @@ function DoDrawWindow(ctx, x, y, w, h) { var flags = ctx.DRAWWINDOW_DRAW_CARET | ctx.DRAWWINDOW_DRAW_VIEW; var testRect = gBrowser.getBoundingClientRect(); - if (0 <= testRect.left && - 0 <= testRect.top && - window.innerWidth >= testRect.right && - window.innerHeight >= testRect.bottom) { + if (gIgnoreWindowSize || + (0 <= testRect.left && + 0 <= testRect.top && + window.innerWidth >= testRect.right && + window.innerHeight >= testRect.bottom)) { // We can use the window's retained layer manager // because the window is big enough to display the entire // browser element diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index b17d067b8f9a..1bbf21dbb102 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -407,12 +407,13 @@ def main(): print "ERROR: Invalid options specified, use --help for a list of valid options" sys.exit(1) - parts = dm.getInfo('screen')['screen'][0].split() - width = int(parts[0].split(':')[1]) - height = int(parts[1].split(':')[1]) - if (width < 1050 or height < 1050): - print "ERROR: Invalid screen resolution %sx%s, please adjust to 1366x1050 or higher" % (width, height) - sys.exit(1) + if not options.ignoreWindowSize: + parts = dm.getInfo('screen')['screen'][0].split() + width = int(parts[0].split(':')[1]) + height = int(parts[1].split(':')[1]) + if (width < 1050 or height < 1050): + print "ERROR: Invalid screen resolution %sx%s, please adjust to 1366x1050 or higher" % (width, height) + sys.exit(1) automation.setAppName(options.app) automation.setRemoteProfile(options.remoteProfile) diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index 2b3c09008276..a036a9bf17e9 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -88,6 +88,8 @@ class RefTest(object): prefsFile.write('user_pref("reftest.thisChunk", %d);\n' % options.thisChunk) if options.logFile != None: prefsFile.write('user_pref("reftest.logFile", "%s");\n' % options.logFile) + if options.ignoreWindowSize != False: + prefsFile.write('user_pref("reftest.ignoreWindowSize", true);\n') for v in options.extraPrefs: thispref = v.split("=") @@ -254,6 +256,11 @@ class ReftestOptions(OptionParser): help = "skip tests marked as slow when running") defaults["skipSlowTests"] = False + self.add_option("--ignore-window-size", + dest = "ignoreWindowSize", action = "store_true", + help = "ignore the window size, which may cause spurious failures and passes") + defaults["ignoreWindowSize"] = False + self.add_option("--install-extension", action = "append", dest = "extensionsToInstall", help = "install the specified extension in the testing profile."