WebKit Bugzilla
Attachment 371096 Details for
Bug 198442
: Make tests that use UIHelper more robust under certain configurations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198442-20190531162551.patch (text/plain), 15.76 KB, created by
Wenson Hsieh
on 2019-05-31 16:25:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-05-31 16:25:52 PDT
Size:
15.76 KB
patch
obsolete
>Subversion Revision: 245993 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 9987f1f9af3ea515b6c462a6e1592eb32588924f..c39e761af3ebd58126c72c53e0a2a91b506bc6df 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Make tests that use UIHelper more robust under certain configurations >+ https://bugs.webkit.org/show_bug.cgi?id=198442 >+ <rdar://problem/51301737> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ For a certain device class, many tests that attempt to use UIHelper.isIOS are currently failing. We can fix this >+ by making the `isIOS` check more robust; this patch also renames `isIOS` to `isIOSFamily`, which is more >+ accurate (and consistent with the corresponding PLATFORM macro name). >+ >+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ (WTR::TestRunner::isIOSFamily const): >+ > 2019-05-31 Tim Horton <timothy_horton@apple.com> > > REGRESSION: WebKit.InteractionDeadlockAfterCrash and SynchronousTimeoutTests.UnresponsivePageDoesNotCausePositionInformationToHangUI API tests are failing >diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >index f6e790964060d575ce7a9660042080052acbef89..48f74e7e7ce0dabcbe926e814f906b736136a592 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >@@ -25,6 +25,7 @@ > > interface TestRunner { > readonly attribute boolean isWebKit2; >+ readonly attribute boolean isIOSFamily; > > // The basics. > void dumpAsText(boolean dumpPixels); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >index 39244e35cdcc63f1dde5f42ba6bece4d12a6a75b..3a26b05c1b8a23e31bac4df82a59249419d8d6cc 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >@@ -48,6 +48,15 @@ public: > > void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); > >+ bool isIOSFamily() const >+ { >+#if PLATFORM(IOS_FAMILY) >+ return true; >+#else >+ return false; >+#endif >+ } >+ > bool isWebKit2() const { return true; } > > // The basics. >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 4021d3d888255bd49a98639debdc74d3f359b0ac..9f1b622a5bce133bfc04310b3ea71257560a64df 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,36 @@ >+2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Make tests that use UIHelper more robust under certain configurations >+ https://bugs.webkit.org/show_bug.cgi?id=198442 >+ <rdar://problem/51301737> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replace usages of `UIHelper.isIOS` with `UIHelper.isIOSFamily`. >+ >+ * fast/dom/iframe-inner-size-scaling.html: >+ * fast/forms/datalist/datalist-show-hide.html: >+ * fast/forms/datalist/datalist-textinput-suggestions-order.html: >+ * fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html: >+ >+ Also remove a workaround here that forces `isIOS` to return `true`. >+ >+ * resources/ui-helper.js: >+ (window.UIHelper.isIOSFamily): >+ (window.UIHelper.isWebKit2): >+ (window.UIHelper.humanSpeedDoubleTapAt): >+ (window.UIHelper.humanSpeedZoomByDoubleTappingAt): >+ (window.UIHelper.zoomByDoubleTappingAt): >+ (window.UIHelper.async.doubleActivateAt): >+ (window.UIHelper.async.doubleActivateAtSelectionStart): >+ (window.UIHelper.async.selectWordByDoubleTapOrClick): >+ (window.UIHelper.keyDown): >+ (window.UIHelper.deactivateFormControl): >+ (window.UIHelper.typeCharacter): >+ (window.UIHelper.inputViewBounds): >+ (window.UIHelper.contentOffset): >+ (window.UIHelper.isIOS): Deleted. >+ > 2019-05-31 Ryosuke Niwa <rniwa@webkit.org> > > [iOS] Reveal the focused element when it's immediately above software keyboard >diff --git a/LayoutTests/fast/dom/iframe-inner-size-scaling.html b/LayoutTests/fast/dom/iframe-inner-size-scaling.html >index fa2821279e3144b109b607d4cf1d3f9063e6eeff..e7ba1347a3dcd35c990242ceca1d253d7b97afd8 100644 >--- a/LayoutTests/fast/dom/iframe-inner-size-scaling.html >+++ b/LayoutTests/fast/dom/iframe-inner-size-scaling.html >@@ -17,7 +17,7 @@ > shouldBeNonZero("frame.contentWindow.innerHeight"); > shouldBe("frame.contentWindow.innerWidth", "originalWidth"); > >- scrollbarWidth = UIHelper.isIOS() ? 0 : 15; >+ scrollbarWidth = UIHelper.isIOSFamily() ? 0 : 15; > shouldBe("frame.contentWindow.innerHeight", "originalHeight - scrollbarWidth"); > finishJSTest(); > } >diff --git a/LayoutTests/fast/forms/datalist/datalist-show-hide.html b/LayoutTests/fast/forms/datalist/datalist-show-hide.html >index e33e3a60cb53ac87794d71fe97701176698c787a..70647de4fcfd77c9249dcaf1f40eb32007a41b51 100644 >--- a/LayoutTests/fast/forms/datalist/datalist-show-hide.html >+++ b/LayoutTests/fast/forms/datalist/datalist-show-hide.html >@@ -50,14 +50,14 @@ function waitForDataListSuggestionsToChangeVisibility(visible) > async function runTest() { > await UIHelper.activateAndWaitForInputSessionAt(150, 25); > >- if (UIHelper.isIOS()) { >+ if (UIHelper.isIOSFamily()) { > await UIHelper.tapAt(290, 30); > await waitForDataListSuggestionsToChangeVisibility(true); > } > > before.textContent = await UIHelper.isShowingDataListSuggestions(); > >- if (UIHelper.isIOS()) { >+ if (UIHelper.isIOSFamily()) { > await UIHelper.tapAt(150, 25); > await waitForDataListSuggestionsToChangeVisibility(false); > } else >diff --git a/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html b/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html >index 60f1640e9f8d713b900b8c83ddd2669888d8f2f8..bf57b3a4bab09d52d639e6d9d6fe5c819015f343 100644 >--- a/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html >+++ b/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html >@@ -45,7 +45,7 @@ function focusInputFieldAndChooseFirstSuggestion() > { > return new Promise(async resolve => { > await UIHelper.activateAndWaitForInputSessionAt(100, 25); >- if (UIHelper.isIOS()) { >+ if (UIHelper.isIOSFamily()) { > await UIHelper.tapAt(290, 30); > await UIHelper.resignFirstResponder(); > await UIHelper.waitForKeyboardToHide(); >diff --git a/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html b/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html >index 63da36fa3e95ce47edcecdaa685ca21dce2d6406..357663fabc5a0b877a5a97027eb7ad168355f4b6 100644 >--- a/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html >+++ b/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html >@@ -30,7 +30,6 @@ async function runTest() { > const resizeEvent = listenForEventOnce(target, 'focus').then(() => listenForEventOnce(visualViewport, 'resize')); > > if (window.testRunner) { >- UIHelper.isIOS = () => true; > await UIHelper.setHardwareKeyboardAttached(false); > await UIHelper.activateElementAndWaitForInputSession(target); > } >diff --git a/LayoutTests/resources/ui-helper.js b/LayoutTests/resources/ui-helper.js >index 0bd5aba756933bf434cdea318a2abd607d0c278a..6aa67550eb1f22b13688e13bd48f2869b94e4215 100644 >--- a/LayoutTests/resources/ui-helper.js >+++ b/LayoutTests/resources/ui-helper.js >@@ -1,13 +1,13 @@ > > window.UIHelper = class UIHelper { >- static isIOS() >+ static isIOSFamily() > { >- return navigator.userAgent.includes('iPhone') || navigator.userAgent.includes('iPad'); >+ return testRunner.isIOSFamily; > } > > static isWebKit2() > { >- return window.testRunner.isWebKit2; >+ return testRunner.isWebKit2; > } > > static doubleClickAt(x, y) >@@ -31,7 +31,7 @@ window.UIHelper = class UIHelper { > > static tapAt(x, y, modifiers=[]) > { >- console.assert(this.isIOS()); >+ console.assert(this.isIOSFamily()); > > if (!this.isWebKit2()) { > console.assert(!modifiers || !modifiers.length); >@@ -52,7 +52,7 @@ window.UIHelper = class UIHelper { > > static doubleTapAt(x, y) > { >- console.assert(this.isIOS()); >+ console.assert(this.isIOSFamily()); > > if (!this.isWebKit2()) { > eventSender.addTouchPoint(x, y); >@@ -76,7 +76,7 @@ window.UIHelper = class UIHelper { > > static humanSpeedDoubleTapAt(x, y) > { >- console.assert(this.isIOS()); >+ console.assert(this.isIOSFamily()); > > if (!this.isWebKit2()) { > // FIXME: Add a sleep in here. >@@ -101,7 +101,7 @@ window.UIHelper = class UIHelper { > > static humanSpeedZoomByDoubleTappingAt(x, y) > { >- console.assert(this.isIOS()); >+ console.assert(this.isIOSFamily()); > > if (!this.isWebKit2()) { > // FIXME: Add a sleep in here. >@@ -133,7 +133,7 @@ window.UIHelper = class UIHelper { > > static zoomByDoubleTappingAt(x, y) > { >- console.assert(this.isIOS()); >+ console.assert(this.isIOSFamily()); > > if (!this.isWebKit2()) { > eventSender.addTouchPoint(x, y); >@@ -159,7 +159,7 @@ window.UIHelper = class UIHelper { > > static activateAt(x, y) > { >- if (!this.isWebKit2() || !this.isIOS()) { >+ if (!this.isWebKit2() || !this.isIOSFamily()) { > eventSender.mouseMoveTo(x, y); > eventSender.mouseDown(); > eventSender.mouseUp(); >@@ -183,7 +183,7 @@ window.UIHelper = class UIHelper { > > static async doubleActivateAt(x, y) > { >- if (this.isIOS()) >+ if (this.isIOSFamily()) > await UIHelper.doubleTapAt(x, y); > else > await UIHelper.doubleClickAt(x, y); >@@ -194,7 +194,7 @@ window.UIHelper = class UIHelper { > const rects = window.getSelection().getRangeAt(0).getClientRects(); > const x = rects[0].left; > const y = rects[0].top; >- if (this.isIOS()) { >+ if (this.isIOSFamily()) { > await UIHelper.activateAndWaitForInputSessionAt(x, y); > await UIHelper.doubleTapAt(x, y); > // This is only here to deal with async/sync copy/paste calls, so >@@ -209,7 +209,7 @@ window.UIHelper = class UIHelper { > const boundingRect = element.getBoundingClientRect(); > const x = boundingRect.x + relativeX; > const y = boundingRect.y + relativeY; >- if (this.isIOS()) { >+ if (this.isIOSFamily()) { > await UIHelper.activateAndWaitForInputSessionAt(x, y); > await UIHelper.doubleTapAt(x, y); > // This is only here to deal with async/sync copy/paste calls, so >@@ -222,7 +222,7 @@ window.UIHelper = class UIHelper { > > static keyDown(key, modifiers=[]) > { >- if (!this.isWebKit2() || !this.isIOS()) { >+ if (!this.isWebKit2() || !this.isIOSFamily()) { > eventSender.keyDown(key, modifiers); > return Promise.resolve(); > } >@@ -311,7 +311,7 @@ window.UIHelper = class UIHelper { > > static activateAndWaitForInputSessionAt(x, y) > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return this.activateAt(x, y); > > return new Promise(resolve => { >@@ -334,7 +334,7 @@ window.UIHelper = class UIHelper { > > static activateFormControl(element) > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return this.activateElement(element); > > const x = element.offsetLeft + element.offsetWidth / 2; >@@ -367,7 +367,7 @@ window.UIHelper = class UIHelper { > > static deactivateFormControl(element) > { >- if (!this.isWebKit2() || !this.isIOS()) { >+ if (!this.isWebKit2() || !this.isIOSFamily()) { > element.blur(); > return Promise.resolve(); > } >@@ -384,7 +384,7 @@ window.UIHelper = class UIHelper { > > static waitForPopoverToPresent() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -400,7 +400,7 @@ window.UIHelper = class UIHelper { > > static waitForPopoverToDismiss() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -416,7 +416,7 @@ window.UIHelper = class UIHelper { > > static waitForKeyboardToHide() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -432,7 +432,7 @@ window.UIHelper = class UIHelper { > > static getUICaretRect() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -448,7 +448,7 @@ window.UIHelper = class UIHelper { > > static getUISelectionRects() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -464,7 +464,7 @@ window.UIHelper = class UIHelper { > > static getUICaretViewRect() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -480,7 +480,7 @@ window.UIHelper = class UIHelper { > > static getUISelectionViewRects() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -496,7 +496,7 @@ window.UIHelper = class UIHelper { > > static getSelectionStartGrabberViewRect() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -512,7 +512,7 @@ window.UIHelper = class UIHelper { > > static getSelectionEndGrabberViewRect() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -634,7 +634,7 @@ window.UIHelper = class UIHelper { > > static typeCharacter(characterString) > { >- if (!this.isWebKit2() || !this.isIOS()) { >+ if (!this.isWebKit2() || !this.isIOSFamily()) { > eventSender.keyDown(characterString); > return; > } >@@ -656,7 +656,7 @@ window.UIHelper = class UIHelper { > > static inputViewBounds() > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => { >@@ -795,7 +795,7 @@ window.UIHelper = class UIHelper { > > static contentOffset() > { >- if (!this.isIOS()) >+ if (!this.isIOSFamily()) > return Promise.resolve(); > > const uiScript = "JSON.stringify([uiController.contentOffsetX, uiController.contentOffsetY])"; >@@ -909,7 +909,7 @@ window.UIHelper = class UIHelper { > > static rotateDevice(orientationName, animatedResize = false) > { >- if (!this.isWebKit2() || !this.isIOS()) >+ if (!this.isWebKit2() || !this.isIOSFamily()) > return Promise.resolve(); > > return new Promise(resolve => {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198442
: 371096