Bug 162657 - Make it possible to test web-related user-interface features
Summary: Make it possible to test web-related user-interface features
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-27 19:39 PDT by Megan Gardner
Modified: 2016-09-30 11:42 PDT (History)
5 users (show)

See Also:


Attachments
Patch (9.38 KB, patch)
2016-09-27 19:53 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.80 KB, patch)
2016-09-29 15:57 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (13.79 KB, patch)
2016-09-30 11:17 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2016-09-27 19:39:44 PDT
Test for long press on image
Comment 1 Megan Gardner 2016-09-27 19:53:13 PDT
Created attachment 290050 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-09-29 14:30:16 PDT
Comment on attachment 290050 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=290050&action=review

r- for the build breakage, but looks good. The actual new test is missing, though.

> Source/WebKit2/ChangeLog:10
> +        Wrote a test for long press on an image, and used the sheet scraping functionality
> +        to make sure that the correct actions were being displayed.

You might want to reference the revision that added the code you're now testing.

> Source/WebKit2/ChangeLog:12
> +        Reviewed by NOBODY (OOPS!).

This line should go above the description

> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:266
> +- (NSDictionary *)contentsOfUserInterfaceItem:(NSString *)userInterfaceItem WK_API_AVAILABLE(ios(WK_IOS_TBA));

This should have a leading underscore, as we do for all private properties and functions (as should the ones above, which I'll fix later).

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h:234
>  - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
> +- (NSDictionary *)contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;

We should use underscores here as well; put one on contentsOfUserInterfaceItem.

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3855
> +        return @{userInterfaceItem:[_actionSheetAssistant currentAvailableActionStrings]};

Preferred spacing is:
return @{ userInterfaceItem: [_actionSheetAssistant currentAvailableActionStrings] };

> Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:77
> +    JSObjectRef contentsOfUserInterfaceItem(JSStringRef item) const;

No need for the "item" parameter name.

> Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:65
> +    // Returned object has a list of string the describe actions

Comment isn't quite accurate: its'a dictionary with a key matching interfaceItem which might have arbitrary content inside.
Comment 3 Megan Gardner 2016-09-29 15:57:59 PDT
Created attachment 290258 [details]
Patch
Comment 4 Simon Fraser (smfr) 2016-09-29 17:04:28 PDT
Comment on attachment 290258 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=290258&action=review

> Source/WebKit2/ChangeLog:3
> +        Test for long press on image

This title isn't really accurate. It's "Make it possible to test web-related user-interface features" or something.

> Source/WebKit2/ChangeLog:11
> +        Wrote a test for long press on an image, and used the sheet scraping functionality

s/Wrote/Add

> Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h:75
> +- (NSArray *)currentAvailableActionStrings;

"strings" is a bit vague. "titles"?

> Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:224
> +    for (UIAlertAction *action in _interactionSheet.get().actions)
> +        [array addObject:action.title];

This gets localized text. Is this OK, or should we stringify the action enum values?

> LayoutTests/fast/events/touch/ios/long-press-on-image.html:33
> +					var actionDictionary = JSON.parse(result);

Please de-tab the file.

> LayoutTests/fast/events/touch/ios/long-press-on-image.html:42
> +						output += 'Available Actions: <br>';
> +						var arrayLength = actionStrings.length;
> +						for (var i = 0; i < arrayLength; i++) {
> +						    output += actionStrings[i] + '<br>';
> +						}

You could do this with an Array.join(separator).
Comment 5 Megan Gardner 2016-09-30 11:17:59 PDT
Created attachment 290353 [details]
Patch
Comment 6 WebKit Commit Bot 2016-09-30 11:41:54 PDT
Comment on attachment 290353 [details]
Patch

Clearing flags on attachment: 290353

Committed r206645: <http://trac.webkit.org/changeset/206645>
Comment 7 WebKit Commit Bot 2016-09-30 11:42:00 PDT
All reviewed patches have been landed.  Closing bug.