⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 251012 in webkit


Ignore:
Timestamp:
Oct 11, 2019, 10:22:28 AM (7 years ago)
Author:
dino@apple.com
Message:

REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing
​https://bugs.webkit.org/show_bug.cgi?id=202845
Source/WebKit:

Reviewed by Antoine Quint.

Update _contentsOfUserInterfaceItem so that it returns more information
on a context menu.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _contentsOfUserInterfaceItem:]):

LayoutTests:

<rdar://51717197>

Reviewed by Antoine Quint.

This test failed because images no longer pop up action sheets, but
instead use context menus.

We no longer need to test the actions in the context menu here, since
it is covered by the TestWebKitAPI/Tests/WebKitCocoa/ContextMenus test.

However, we can still use this test to ensure we are getting a
context menu on the correct element.

  • fast/events/touch/ios/long-press-on-image-expected.txt:
  • fast/events/touch/ios/long-press-on-image.html:
  • platform/iphone-7/fast/events/touch/force-press-on-link.html: This

test currently fails and needs to be rewritten (rdar://problem/52699530),
but at least update it to use the new data from the Internal API.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251009 r251012  
     12019-10-11  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=202845
     5        <rdar://51717197>
     6
     7        Reviewed by Antoine Quint.
     8
     9        This test failed because images no longer pop up action sheets, but
     10        instead use context menus.
     11
     12        We no longer need to test the actions in the context menu here, since
     13        it is covered by the TestWebKitAPI/Tests/WebKitCocoa/ContextMenus test.
     14
     15        However, we can still use this test to ensure we are getting a
     16        context menu on the correct element.
     17
     18        * fast/events/touch/ios/long-press-on-image-expected.txt:
     19        * fast/events/touch/ios/long-press-on-image.html:
     20        * platform/iphone-7/fast/events/touch/force-press-on-link.html: This
     21        test currently fails and needs to be rewritten (rdar://problem/52699530),
     22        but at least update it to use the new data from the Internal API.
     23
    1242019-10-11  Peng Liu  <peng.liu6@apple.com>
    225
  • trunk/LayoutTests/fast/events/touch/ios/long-press-on-image-expected.txt

    r244482 r251012  
    1 Available Actions:
    2 Share…
    3 Add to Photos
    4 Copy
    5 Cancel
    6 PASS
     1PASS: context menu triggered on image
  • trunk/LayoutTests/fast/events/touch/ios/long-press-on-image.html

    r244482 r251012  
    1515            (function() {
    1616                uiController.longPressAtPoint(30, 20, function() {
    17                     uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('actionSheet')));
     17                    uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('contextMenu')));
    1818                });
    1919             })();`
    … …  
    2828            if (testRunner.runUIScript) {
    2929                testRunner.runUIScript(getUIScript(), function(result) {
    30                     var actionDictionary = JSON.parse(result);
    31                     var actionStrings = actionDictionary.actionSheet;
     30                    var results = JSON.parse(result).contextMenu;
    3231                    var output = '';
    33                     if (actionStrings[0] == 'Share…' && actionStrings[1] == 'Add to Photos' && actionStrings[2] == 'Copy' && actionStrings[3] == 'Cancel') {
    34                         output += 'Available Actions: <br>';
    35                         output +=  actionStrings.join('<br>');
    36                         output += '<br>';
    37                         output += 'PASS';
    38                     }
    39                     else {
    40                         output += 'Available Actions: <br>';
    41                         output += actionStrings.join('<br>');
    42                         output += '<br>';
    43                         output += 'FAIL'
    44                     }
     32                    if (results.imageURL.includes("dice.png") && results.isImage && !results.isLink)
     33                        output += 'PASS: context menu triggered on image';
     34                    else
     35                        output += 'FAIL: context menu was not triggered on image';
    4536
    4637                    document.getElementById('target').innerHTML = output;
  • trunk/LayoutTests/platform/iphone-7/fast/events/touch/force-press-on-link.html

    r240150 r251012  
    5353             
    5454                uiController.didShowForcePressPreviewCallback = function() {
    55                     uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('linkPreviewPopoverContents')));
     55                    uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('contextMenu')));
    5656                };
    5757             
    … …  
    7979            if (testRunner.runUIScript) {
    8080                testRunner.runUIScript(getUIScript(), function(result) {
    81                     var uiContentsDictionary = JSON.parse(result);
    82                     var pageURL = uiContentsDictionary.linkPreviewPopoverContents.pageURL;
    83                     if (pageURL = 'http://localhost:54321')
     81                    var results = JSON.parse(result).contextMenu;
     82                    if (results.url == 'http://localhost:54321' && results.isLink)
    8483                        output += 'PASS: correct page loaded in popover';
    8584                    document.getElementById('target').innerHTML = output;
  • trunk/Source/WebKit/ChangeLog

    r251011 r251012  
     12019-10-11  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=202845
     5
     6        Reviewed by Antoine Quint.
     7
     8        Update _contentsOfUserInterfaceItem so that it returns more information
     9        on a context menu.
     10
     11        * UIProcess/ios/WKContentViewInteraction.mm:
     12        (-[WKContentView _contentsOfUserInterfaceItem:]):
     13
    1142019-10-11  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r250876 r251012  
    78967896
    78977897#if HAVE(LINK_PREVIEW)
    7898     if ([userInterfaceItem isEqualToString:@"linkPreviewPopoverContents"]) {
     7898    if ([userInterfaceItem isEqualToString:@"contextMenu"]) {
    78997899        if (self._shouldUseContextMenus)
    7900             return @{ userInterfaceItem: @{ @"pageURL": WTF::userVisibleString(_positionInformation.url) } };
     7900            return @{ userInterfaceItem: @{
     7901                @"url": _positionInformation.url.isValid() ? WTF::userVisibleString(_positionInformation.url) : @"",
     7902                @"isLink": [NSNumber numberWithBool:_positionInformation.isLink],
     7903                @"isImage": [NSNumber numberWithBool:_positionInformation.isImage],
     7904                @"imageURL": _positionInformation.imageURL.isValid() ? WTF::userVisibleString(_positionInformation.imageURL) : @""
     7905            } };
    79017906
    79027907        NSString *url = [_previewItemController previewData][UIPreviewDataLink];
    7903         return @{ userInterfaceItem: @{ @"pageURL": url } };
     7908        return @{ userInterfaceItem: @{
     7909            @"url": url,
     7910            @"isLink": [NSNumber numberWithBool:_positionInformation.isLink],
     7911            @"isImage": [NSNumber numberWithBool:_positionInformation.isImage],
     7912            @"imageURL": _positionInformation.imageURL.isValid() ? WTF::userVisibleString(_positionInformation.imageURL) : @""
     7913        } };
    79047914    }
    79057915#endif
Note: See TracChangeset for help on using the changeset viewer.