Changeset 246004 in webkit
- Timestamp:
- May 31, 2019, 5:43:56 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/iframe-inner-size-scaling.html (modified) (1 diff)
-
LayoutTests/fast/forms/datalist/datalist-show-hide.html (modified) (2 diffs)
-
LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html (modified) (1 diff)
-
LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html (modified) (1 diff)
-
LayoutTests/resources/ui-helper.js (modified) (27 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246002 r246004 1 2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Make tests that use UIHelper more robust under certain configurations 4 https://bugs.webkit.org/show_bug.cgi?id=198442 5 <rdar://problem/51301737> 6 7 Reviewed by Megan Gardner. 8 9 Replace usages of `UIHelper.isIOS` with `UIHelper.isIOSFamily`. 10 11 * fast/dom/iframe-inner-size-scaling.html: 12 * fast/forms/datalist/datalist-show-hide.html: 13 * fast/forms/datalist/datalist-textinput-suggestions-order.html: 14 * fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html: 15 16 Also remove a workaround here that forces `isIOS` to return `true`. 17 18 * resources/ui-helper.js: 19 (window.UIHelper.isIOSFamily): 20 (window.UIHelper.isWebKit2): 21 (window.UIHelper.humanSpeedDoubleTapAt): 22 (window.UIHelper.humanSpeedZoomByDoubleTappingAt): 23 (window.UIHelper.zoomByDoubleTappingAt): 24 (window.UIHelper.async.doubleActivateAt): 25 (window.UIHelper.async.doubleActivateAtSelectionStart): 26 (window.UIHelper.async.selectWordByDoubleTapOrClick): 27 (window.UIHelper.keyDown): 28 (window.UIHelper.deactivateFormControl): 29 (window.UIHelper.typeCharacter): 30 (window.UIHelper.inputViewBounds): 31 (window.UIHelper.contentOffset): 32 (window.UIHelper.isIOS): Deleted. 33 1 34 2019-05-31 Youenn Fablet <youenn@apple.com> 2 35 -
trunk/LayoutTests/fast/dom/iframe-inner-size-scaling.html
r225791 r246004 18 18 shouldBe("frame.contentWindow.innerWidth", "originalWidth"); 19 19 20 scrollbarWidth = UIHelper.isIOS () ? 0 : 15;20 scrollbarWidth = UIHelper.isIOSFamily() ? 0 : 15; 21 21 shouldBe("frame.contentWindow.innerHeight", "originalHeight - scrollbarWidth"); 22 22 finishJSTest(); -
trunk/LayoutTests/fast/forms/datalist/datalist-show-hide.html
r237328 r246004 51 51 await UIHelper.activateAndWaitForInputSessionAt(150, 25); 52 52 53 if (UIHelper.isIOS ()) {53 if (UIHelper.isIOSFamily()) { 54 54 await UIHelper.tapAt(290, 30); 55 55 await waitForDataListSuggestionsToChangeVisibility(true); … … 58 58 before.textContent = await UIHelper.isShowingDataListSuggestions(); 59 59 60 if (UIHelper.isIOS ()) {60 if (UIHelper.isIOSFamily()) { 61 61 await UIHelper.tapAt(150, 25); 62 62 await waitForDataListSuggestionsToChangeVisibility(false); -
trunk/LayoutTests/fast/forms/datalist/datalist-textinput-suggestions-order.html
r237305 r246004 46 46 return new Promise(async resolve => { 47 47 await UIHelper.activateAndWaitForInputSessionAt(100, 25); 48 if (UIHelper.isIOS ()) {48 if (UIHelper.isIOSFamily()) { 49 49 await UIHelper.tapAt(290, 30); 50 50 await UIHelper.resignFirstResponder(); -
trunk/LayoutTests/fast/scrolling/ios/reveal-focused-element-right-above-keyboard-on-ipad.html
r245993 r246004 31 31 32 32 if (window.testRunner) { 33 UIHelper.isIOS = () => true;34 33 await UIHelper.setHardwareKeyboardAttached(false); 35 34 await UIHelper.activateElementAndWaitForInputSession(target); -
trunk/LayoutTests/resources/ui-helper.js
r245561 r246004 1 1 2 2 window.UIHelper = class UIHelper { 3 static isIOS ()4 { 5 return navigator.userAgent.includes('iPhone') || navigator.userAgent.includes('iPad');3 static isIOSFamily() 4 { 5 return testRunner.isIOSFamily; 6 6 } 7 7 8 8 static isWebKit2() 9 9 { 10 return window.testRunner.isWebKit2;10 return testRunner.isWebKit2; 11 11 } 12 12 … … 32 32 static tapAt(x, y, modifiers=[]) 33 33 { 34 console.assert(this.isIOS ());34 console.assert(this.isIOSFamily()); 35 35 36 36 if (!this.isWebKit2()) { … … 53 53 static doubleTapAt(x, y) 54 54 { 55 console.assert(this.isIOS ());55 console.assert(this.isIOSFamily()); 56 56 57 57 if (!this.isWebKit2()) { … … 77 77 static humanSpeedDoubleTapAt(x, y) 78 78 { 79 console.assert(this.isIOS ());79 console.assert(this.isIOSFamily()); 80 80 81 81 if (!this.isWebKit2()) { … … 102 102 static humanSpeedZoomByDoubleTappingAt(x, y) 103 103 { 104 console.assert(this.isIOS ());104 console.assert(this.isIOSFamily()); 105 105 106 106 if (!this.isWebKit2()) { … … 134 134 static zoomByDoubleTappingAt(x, y) 135 135 { 136 console.assert(this.isIOS ());136 console.assert(this.isIOSFamily()); 137 137 138 138 if (!this.isWebKit2()) { … … 160 160 static activateAt(x, y) 161 161 { 162 if (!this.isWebKit2() || !this.isIOS ()) {162 if (!this.isWebKit2() || !this.isIOSFamily()) { 163 163 eventSender.mouseMoveTo(x, y); 164 164 eventSender.mouseDown(); … … 184 184 static async doubleActivateAt(x, y) 185 185 { 186 if (this.isIOS ())186 if (this.isIOSFamily()) 187 187 await UIHelper.doubleTapAt(x, y); 188 188 else … … 195 195 const x = rects[0].left; 196 196 const y = rects[0].top; 197 if (this.isIOS ()) {197 if (this.isIOSFamily()) { 198 198 await UIHelper.activateAndWaitForInputSessionAt(x, y); 199 199 await UIHelper.doubleTapAt(x, y); … … 210 210 const x = boundingRect.x + relativeX; 211 211 const y = boundingRect.y + relativeY; 212 if (this.isIOS ()) {212 if (this.isIOSFamily()) { 213 213 await UIHelper.activateAndWaitForInputSessionAt(x, y); 214 214 await UIHelper.doubleTapAt(x, y); … … 223 223 static keyDown(key, modifiers=[]) 224 224 { 225 if (!this.isWebKit2() || !this.isIOS ()) {225 if (!this.isWebKit2() || !this.isIOSFamily()) { 226 226 eventSender.keyDown(key, modifiers); 227 227 return Promise.resolve(); … … 312 312 static activateAndWaitForInputSessionAt(x, y) 313 313 { 314 if (!this.isWebKit2() || !this.isIOS ())314 if (!this.isWebKit2() || !this.isIOSFamily()) 315 315 return this.activateAt(x, y); 316 316 … … 335 335 static activateFormControl(element) 336 336 { 337 if (!this.isWebKit2() || !this.isIOS ())337 if (!this.isWebKit2() || !this.isIOSFamily()) 338 338 return this.activateElement(element); 339 339 … … 368 368 static deactivateFormControl(element) 369 369 { 370 if (!this.isWebKit2() || !this.isIOS ()) {370 if (!this.isWebKit2() || !this.isIOSFamily()) { 371 371 element.blur(); 372 372 return Promise.resolve(); … … 385 385 static waitForPopoverToPresent() 386 386 { 387 if (!this.isWebKit2() || !this.isIOS ())387 if (!this.isWebKit2() || !this.isIOSFamily()) 388 388 return Promise.resolve(); 389 389 … … 401 401 static waitForPopoverToDismiss() 402 402 { 403 if (!this.isWebKit2() || !this.isIOS ())403 if (!this.isWebKit2() || !this.isIOSFamily()) 404 404 return Promise.resolve(); 405 405 … … 417 417 static waitForKeyboardToHide() 418 418 { 419 if (!this.isWebKit2() || !this.isIOS ())419 if (!this.isWebKit2() || !this.isIOSFamily()) 420 420 return Promise.resolve(); 421 421 … … 433 433 static getUICaretRect() 434 434 { 435 if (!this.isWebKit2() || !this.isIOS ())435 if (!this.isWebKit2() || !this.isIOSFamily()) 436 436 return Promise.resolve(); 437 437 … … 449 449 static getUISelectionRects() 450 450 { 451 if (!this.isWebKit2() || !this.isIOS ())451 if (!this.isWebKit2() || !this.isIOSFamily()) 452 452 return Promise.resolve(); 453 453 … … 465 465 static getUICaretViewRect() 466 466 { 467 if (!this.isWebKit2() || !this.isIOS ())467 if (!this.isWebKit2() || !this.isIOSFamily()) 468 468 return Promise.resolve(); 469 469 … … 481 481 static getUISelectionViewRects() 482 482 { 483 if (!this.isWebKit2() || !this.isIOS ())483 if (!this.isWebKit2() || !this.isIOSFamily()) 484 484 return Promise.resolve(); 485 485 … … 497 497 static getSelectionStartGrabberViewRect() 498 498 { 499 if (!this.isWebKit2() || !this.isIOS ())499 if (!this.isWebKit2() || !this.isIOSFamily()) 500 500 return Promise.resolve(); 501 501 … … 513 513 static getSelectionEndGrabberViewRect() 514 514 { 515 if (!this.isWebKit2() || !this.isIOS ())515 if (!this.isWebKit2() || !this.isIOSFamily()) 516 516 return Promise.resolve(); 517 517 … … 635 635 static typeCharacter(characterString) 636 636 { 637 if (!this.isWebKit2() || !this.isIOS ()) {637 if (!this.isWebKit2() || !this.isIOSFamily()) { 638 638 eventSender.keyDown(characterString); 639 639 return; … … 657 657 static inputViewBounds() 658 658 { 659 if (!this.isWebKit2() || !this.isIOS ())659 if (!this.isWebKit2() || !this.isIOSFamily()) 660 660 return Promise.resolve(); 661 661 … … 796 796 static contentOffset() 797 797 { 798 if (!this.isIOS ())798 if (!this.isIOSFamily()) 799 799 return Promise.resolve(); 800 800 … … 910 910 static rotateDevice(orientationName, animatedResize = false) 911 911 { 912 if (!this.isWebKit2() || !this.isIOS ())912 if (!this.isWebKit2() || !this.isIOSFamily()) 913 913 return Promise.resolve(); 914 914 -
trunk/Tools/ChangeLog
r245998 r246004 1 2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Make tests that use UIHelper more robust under certain configurations 4 https://bugs.webkit.org/show_bug.cgi?id=198442 5 <rdar://problem/51301737> 6 7 Reviewed by Megan Gardner. 8 9 For a certain device class, many tests that attempt to use UIHelper.isIOS are currently failing. We can fix this 10 by making the `isIOS` check more robust; this patch also renames `isIOS` to `isIOSFamily`, which is more 11 accurate (and consistent with the corresponding PLATFORM macro name). 12 13 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 14 * WebKitTestRunner/InjectedBundle/TestRunner.h: 15 (WTR::TestRunner::isIOSFamily const): 16 1 17 2019-05-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 18 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r244898 r246004 26 26 interface TestRunner { 27 27 readonly attribute boolean isWebKit2; 28 readonly attribute boolean isIOSFamily; 28 29 29 30 // The basics. -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r244898 r246004 48 48 49 49 void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); 50 51 bool isIOSFamily() const 52 { 53 #if PLATFORM(IOS_FAMILY) 54 return true; 55 #else 56 return false; 57 #endif 58 } 50 59 51 60 bool isWebKit2() const { return true; }
Note:
See TracChangeset
for help on using the changeset viewer.