Changeset 252608 in webkit


Ignore:
Timestamp:
Nov 18, 2019 5:05:14 PM (4 years ago)
Author:
Megan Gardner
Message:

Update dismiss-picker-using-keyboard.html test to work on iPad correctly
https://bugs.webkit.org/show_bug.cgi?id=204257
<rdar://problem/57239690>

Reviewed by Wenson Hsieh.

The iPad does not use the keyboard to show the options for these form controls,
and instead uses a popover. This expands the test infrastructure to allow for
either iPhone or iPad functionality.

  • fast/forms/ios/dismiss-picker-using-keyboard.html:
  • resources/ui-helper.js:

(window.UIHelper.activateAndWaitForInputSessionAt.return.new.Promise.):
(window.UIHelper.waitForInputSessionToDismiss.return.new.Promise.):
(window.UIHelper.waitForInputSessionToDismiss.return.new.Promise):
(window.UIHelper.waitForInputSessionToDismiss):

Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252598 r252608  
     12019-11-18  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Update dismiss-picker-using-keyboard.html test to work on iPad correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=204257
     5        <rdar://problem/57239690>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        The iPad does not use the keyboard to show the options for these form controls,
     10        and instead uses a popover. This expands the test infrastructure to allow for
     11        either iPhone or iPad functionality.
     12
     13        * fast/forms/ios/dismiss-picker-using-keyboard.html:
     14        * resources/ui-helper.js:
     15        (window.UIHelper.activateAndWaitForInputSessionAt.return.new.Promise.):
     16        (window.UIHelper.waitForInputSessionToDismiss.return.new.Promise.):
     17        (window.UIHelper.waitForInputSessionToDismiss.return.new.Promise):
     18        (window.UIHelper.waitForInputSessionToDismiss):
     19
    1202019-11-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
    221
  • trunk/LayoutTests/fast/forms/ios/dismiss-picker-using-keyboard.html

    r243808 r252608  
    7171            await UIHelper.activateElementAndWaitForInputSession(elementToTest);
    7272            UIHelper.keyDown(keyCommand.key, keyCommand.modifiers);
    73             await UIHelper.waitForKeyboardToHide();
     73            await UIHelper.waitForInputSessionToDismiss();
    7474            shouldBeEqualToString("elementToTest.value", expectedValue);
    7575        }
  • trunk/LayoutTests/resources/ui-helper.js

    r252496 r252608  
    355355            testRunner.runUIScript(`
    356356                (function() {
    357                     uiController.didShowKeyboardCallback = function() {
     357                    function clearCallbacksAndScriptComplete() {
     358                        uiController.didShowKeyboardCallback = null;
     359                        uiController.willPresentPopoverCallback = null;
    358360                        uiController.uiScriptComplete();
    359                     };
     361                    }
     362                    uiController.didShowKeyboardCallback = clearCallbacksAndScriptComplete;
     363                    uiController.willPresentPopoverCallback = clearCallbacksAndScriptComplete;
    360364                    uiController.singleTapAtPoint(${x}, ${y}, function() { });
     365                })()`, resolve);
     366        });
     367    }
     368
     369    static waitForInputSessionToDismiss()
     370    {
     371        return new Promise(resolve => {
     372            testRunner.runUIScript(`
     373                (function() {
     374                    function clearCallbacksAndScriptComplete() {
     375                        uiController.didHideKeyboardCallback = null;
     376                        uiController.didDismissPopoverCallback = null;
     377                        uiController.uiScriptComplete();
     378                    }
     379                    uiController.didHideKeyboardCallback = clearCallbacksAndScriptComplete;
     380                    uiController.didDismissPopoverCallback = clearCallbacksAndScriptComplete;
    361381                })()`, resolve);
    362382        });
Note: See TracChangeset for help on using the changeset viewer.