From 7f8dc7e9bdeb8188970a7298cb1fbe9e0c44b851 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 23 Mar 2013 16:38:41 -0500 Subject: [PATCH] Backout Bug 854117 because philor said so --- dom/tests/mochitest/bugs/Makefile.in | 9 ++++- .../bugs/test_resize_move_windows.html | 39 ++++--------------- dom/tests/mochitest/chrome/Makefile.in | 9 ++++- .../chrome/test_resize_move_windows.xul | 24 +++--------- testing/mochitest/android.json | 4 +- testing/mochitest/b2g.json | 4 +- 6 files changed, 33 insertions(+), 56 deletions(-) diff --git a/dom/tests/mochitest/bugs/Makefile.in b/dom/tests/mochitest/bugs/Makefile.in index b236e889ae6..75d1cc25c88 100644 --- a/dom/tests/mochitest/bugs/Makefile.in +++ b/dom/tests/mochitest/bugs/Makefile.in @@ -141,7 +141,14 @@ MOCHITEST_FILES = \ test_bug817476.html \ test_bug823173.html \ test_bug850517.html \ - test_resize_move_windows.html \ $(NULL) +ifneq (Linux,$(OS_ARCH)) +MOCHITEST_FILES += \ + test_resize_move_windows.html \ + $(NULL) +else +$(filter disabled-on-linux-for-timeouts--bug-677841, test_resize_move_windows.html) +endif + include $(topsrcdir)/config/rules.mk diff --git a/dom/tests/mochitest/bugs/test_resize_move_windows.html b/dom/tests/mochitest/bugs/test_resize_move_windows.html index 2592daee75c..a0643d0b769 100644 --- a/dom/tests/mochitest/bugs/test_resize_move_windows.html +++ b/dom/tests/mochitest/bugs/test_resize_move_windows.html @@ -52,14 +52,12 @@ function getNewHeight(aWindow) function getNewX(aWindow) { - return (aWindow.screenX > ((screen.width - aWindow.outerWidth) / 2)) - ? 0 : screen.width - aWindow.outerWidth; + return (aWindow.screenX > (screen.width / 2)) ? 0 : screen.width; } function getNewY(aWindow) { - return (aWindow.screenY > ((screen.height - aWindow.outerHeight) / 2)) - ? 0 : screen.height - aWindow.outerHeight; + return (aWindow.screenY > (screen.height / 2)) ? 0 : screen.height; } /** @@ -182,30 +180,12 @@ function checkChangeIsEnabled(aWindow, aNext) } function posChangeCondition() { - // With GTK, sometimes, only one dimension changes. - if (navigator.platform.indexOf('Linux') != -1) { - return aWindow.screenX != prevX || aWindow.screenY != prevY; - } return aWindow.screenX != prevX && aWindow.screenY != prevY; } function posChangeTest() { - // With GTK, sometimes, only one dimension changes. - if (navigator.platform.indexOf('Linux') != -1) { - // With GTK, sometimes, aWindow.screenX changes during two calls. - // So we call it once and save the returned value. - var x = aWindow.screenX; - var y = aWindow.screenY; - if (x != prevX) { - isnot(x, prevX, "Window x position should have changed"); - } - if (y != prevY) { - isnot(y, prevY, "Window y position should have changed"); - } - } else { - isnot(aWindow.screenX, prevX, "Window x position should have changed"); - isnot(aWindow.screenY, prevY, "Window y position should have changed"); - } + isnot(aWindow.screenX, prevX, "Window x position should have changed"); + isnot(aWindow.screenY, prevY, "Window y position should have changed"); prevX = aWindow.screenX; prevY = aWindow.screenY; @@ -255,14 +235,9 @@ function checkChangeIsEnabled(aWindow, aNext) aWindow.screenY = getNewY(aWindow); hitEventLoop(posChangeCondition, posChangeTest, hits, function () { - prevX = aWindow.screenX; - prevY = aWindow.screenY; - aWindow.moveTo(getNewX(aWindow), getNewY(aWindow)); hitEventLoop(posChangeCondition, posChangeTest, hits, function () { - prevX = aWindow.screenX; - prevY = aWindow.screenY; aWindow.moveBy(getNewX(aWindow) - aWindow.screenX, getNewY(aWindow) - aWindow.screenY); @@ -308,11 +283,11 @@ SimpleTest.waitForFocus(function() { " };" + " is_range(window.innerWidth, 170, 5, 'parameter width should be taken into account');" + " is_range(window.innerHeight, 170, 5, 'parameter height should be taken into account');" + - " is_range(window.screenX, 65, 5, 'parameter screenX should be taken into account');" + - " is_range(window.screenY, 65, 5, 'parameter screenY should be taken into account');" + + " is_range(window.screenX, 120, 5, 'parameter screenX should be taken into account');" + + " is_range(window.screenY, 120, 5, 'parameter screenY should be taken into account');" + " window.opener.checkChangeIsEnabled(window, next);" + "} <\/script>", '', - 'width=170,height=170,screenX=65,screenY=65'); + 'width=170,height=170,screenX=120,screenY=120'); SimpleTest.waitForFocus(function() { w.check(function() { diff --git a/dom/tests/mochitest/chrome/Makefile.in b/dom/tests/mochitest/chrome/Makefile.in index 50f9701af02..5d1b0a082fb 100644 --- a/dom/tests/mochitest/chrome/Makefile.in +++ b/dom/tests/mochitest/chrome/Makefile.in @@ -59,7 +59,6 @@ MOCHITEST_CHROME_FILES = \ test_bug830858.xul \ file_bug830858.xul \ test_indexedSetter.html \ - test_resize_move_windows.xul \ $(NULL) ifeq (WINNT,$(OS_ARCH)) @@ -69,6 +68,14 @@ MOCHITEST_CHROME_FILES += \ $(NULL) endif +ifneq (Linux,$(OS_ARCH)) +MOCHITEST_CHROME_FILES += \ + test_resize_move_windows.xul \ + $(NULL) +else +$(filter disabled-on-linux-for-timeouts--bug-834716, test_resize_move_windows.xul) +endif + ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT)) MOCHITEST_CHROME_FILES += \ test_MozEnteredDomFullscreen_event.xul \ diff --git a/dom/tests/mochitest/chrome/test_resize_move_windows.xul b/dom/tests/mochitest/chrome/test_resize_move_windows.xul index 521cad97050..1286fac81c5 100644 --- a/dom/tests/mochitest/chrome/test_resize_move_windows.xul +++ b/dom/tests/mochitest/chrome/test_resize_move_windows.xul @@ -49,14 +49,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=565541 function getNewX(aWindow) { - return (aWindow.screenX > ((screen.width - aWindow.outerWidth) / 2)) - ? 0 : screen.width - aWindow.outerWidth; + return (aWindow.screenX > (screen.width / 2)) ? 0 : screen.width; } function getNewY(aWindow) { - return (aWindow.screenY > ((screen.height - aWindow.outerHeight) / 2)) - ? 0 : screen.height - aWindow.outerHeight; + return (aWindow.screenY > (screen.height / 2)) ? 0 : screen.height; } /** @@ -112,16 +110,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=565541 return aWindow.screenX != prevX && aWindow.screenY != prevY; } - function posChangeConditionIgnoreLinux() { - if (posChangeCondition()) { - return true; - } - - if (navigator.platform.indexOf('Linux') != -1) { - return true; - } - } - function posChangeTest() { // With GTK, sometimes, only one dimension changes. if (navigator.platform.indexOf('Linux') != -1) { @@ -194,7 +182,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=565541 aWindow.moveBy(getNewX(aWindow) - aWindow.screenX, getNewY(aWindow) - aWindow.screenY); - hitEventLoop(posChangeConditionIgnoreLinux, posChangeTest, hits, function () { + hitEventLoop(posChangeCondition, posChangeTest, hits, function () { /** * Outer width/height checks. */ @@ -234,11 +222,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=565541 " };" + " is_range(window.innerWidth, 170, 5, 'parameter width should be taken into account');" + " is_range(window.innerHeight, 170, 5, 'parameter height should be taken into account');" + - " is_range(window.screenX, 25, 5, 'parameter screenX should be taken into account');" + - " is_range(window.screenY, 25, 5, 'parameter screenY should be taken into account');" + + " is_range(window.screenX, 120, 5, 'parameter screenX should be taken into account');" + + " is_range(window.screenY, 120, 5, 'parameter screenY should be taken into account');" + " checkChangeIsEnabled(window, next);" + "} <\/script>", '', - 'width=170,height=170,screenX=25,screenY=25'); + 'width=170,height=170,screenX=120,screenY=120'); SimpleTest.waitForFocus(function() { w.wrappedJSObject.ok = SimpleTest.ok; diff --git a/testing/mochitest/android.json b/testing/mochitest/android.json index 1ea807f0c32..04da037a57b 100644 --- a/testing/mochitest/android.json +++ b/testing/mochitest/android.json @@ -184,8 +184,8 @@ "dom/tests/mochitest/bugs/test_bug61098.html": "", "dom/tests/mochitest/bugs/test_bug641552.html": "", "dom/tests/mochitest/bugs/test_devicemotion_multiple_listeners.html": "bug 775227", - "dom/tests/mochitest/bugs/test_resize_move_windows.html": "Windows can't change size and position on Android", - "dom/tests/mochitest/bugs/test_sizetocontent_clamp.html": "Windows can't change size on Android", + "dom/tests/mochitest/bugs/test_resize_move_windows.html": "TIMED_OUT", + "dom/tests/mochitest/bugs/test_sizetocontent_clamp.html": "TIMED_OUT", "dom/tests/mochitest/bugs/test_window_bar.html": "", "dom/tests/mochitest/dom-level2-core/test_documentimportnode03.html": "", "dom/tests/mochitest/dom-level2-core/test_documentimportnode04.html": "", diff --git a/testing/mochitest/b2g.json b/testing/mochitest/b2g.json index 04e005d39ee..81bfac18dda 100644 --- a/testing/mochitest/b2g.json +++ b/testing/mochitest/b2g.json @@ -359,8 +359,8 @@ "dom/tests/mochitest/bugs/test_bug641552.html":"", "dom/tests/mochitest/bugs/test_bug642026.html":"", "dom/tests/mochitest/bugs/test_bug648465.html":"", - "dom/tests/mochitest/bugs/test_sizetocontent_clamp.html": "Windows can't change size on B2G", - "dom/tests/mochitest/bugs/test_resize_move_windows.html": "Windows can't change size and position on B2G", + "dom/tests/mochitest/bugs/test_sizetocontent_clamp.html":"", + "dom/tests/mochitest/bugs/test_window_bar.html":"", "dom/tests/mochitest/general/test_497898.html":"", "dom/tests/mochitest/general/test_bug628069_1.html":"",