Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Issue 2275303004: Context menu egtests, plus related utilities. (Closed)

Created:
4 years, 3 months ago by marq (ping after 24h)
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL implements basic context menu egtests that run against the web shell, along with a number of needed utility functions. Apologies for the size of this CL; some of the utility implementations ended up being fairly involved. This CL: (1) moves ExecuteJavascript out of web_view_matchers to be a public utility function in web_view_interaction_test_util. (2) Add web_view_actions and shell_actions for new action providers. (3) Adds ios/testing/earl_grey/matchers for non-web-specific matchers. (4) Adds a "verified action" wrapper that will inject a mousedown event handler and a script callback handler to watch for it, so that UIKit actions that ought to trigger DOM events can be verified. (5) Adds a BoundingRectOfElementWithId() utility to find where (in webview bounds coordinates) an element is. (6) Adds a method that long-presses a webview element to trigger (or not) a context menu. (7) Adds matchers for finding elements in context menus, and finding an element to tap that will dismiss the context menu. The latter encapsulates the differences between iPad and iPhone. (8) Adds header guards to shell_matchers.h and web_view_matchers.h (!) (9) Changes a bunch of std::string params for utility methods to be references. (10) (finally) Implements the upstreamable context menu tests, adding a test for simply triggering the context menu. BUG= Committed: https://crrev.com/c73c7bef14788c1bce67f5ebe896d55108175c5b Cr-Commit-Position: refs/heads/master@{#415670}

Patch Set 1 #

Patch Set 2 : Reviewable. #

Total comments: 63

Patch Set 3 : Review feedback plus some fixes and tweaks. #

Total comments: 4

Patch Set 4 : Fewer References. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+678 lines, -43 lines) Patch
M ios/testing/earl_grey/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
A ios/testing/earl_grey/matchers.h View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
A ios/testing/earl_grey/matchers.mm View 1 2 1 chunk +31 lines, -0 lines 0 comments Download
M ios/web/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A ios/web/public/test/earl_grey/web_view_actions.h View 1 2 1 chunk +37 lines, -0 lines 0 comments Download
A ios/web/public/test/earl_grey/web_view_actions.mm View 1 2 1 chunk +215 lines, -0 lines 0 comments Download
M ios/web/public/test/earl_grey/web_view_matchers.h View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M ios/web/public/test/earl_grey/web_view_matchers.mm View 1 2 3 6 chunks +6 lines, -33 lines 0 comments Download
M ios/web/public/test/web_view_interaction_test_util.h View 1 2 1 chunk +18 lines, -1 line 0 comments Download
M ios/web/public/test/web_view_interaction_test_util.mm View 1 2 2 chunks +97 lines, -2 lines 0 comments Download
M ios/web/shell/test/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
A ios/web/shell/test/context_menu_egtest.mm View 1 2 1 chunk +172 lines, -0 lines 0 comments Download
A ios/web/shell/test/earl_grey/shell_actions.h View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
A ios/web/shell/test/earl_grey/shell_actions.mm View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M ios/web/shell/test/earl_grey/shell_matchers.h View 1 2 3 2 chunks +11 lines, -3 lines 0 comments Download
M ios/web/shell/test/earl_grey/shell_matchers.mm View 1 2 3 2 chunks +7 lines, -2 lines 0 comments Download
M ios/web/shell/view_controller.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (11 generated)
marq (ping after 24h)
4 years, 3 months ago (2016-08-30 17:02:43 UTC) #4
Eugene But (OOO till 7-30)
Thanks for all helpers! https://codereview.chromium.org/2275303004/diff/20001/ios/testing/earl_grey/matchers.h File ios/testing/earl_grey/matchers.h (right): https://codereview.chromium.org/2275303004/diff/20001/ios/testing/earl_grey/matchers.h#newcode15 ios/testing/earl_grey/matchers.h:15: id<GREYMatcher> contextMenuItemContainingText(NSString* text); The name ...
4 years, 3 months ago (2016-08-30 18:11:06 UTC) #5
baxley
Thanks for all the work on this. This is an amazing CL! https://codereview.chromium.org/2275303004/diff/20001/ios/testing/earl_grey/matchers.mm File ios/testing/earl_grey/matchers.mm ...
4 years, 3 months ago (2016-08-31 04:25:43 UTC) #6
baxley
https://codereview.chromium.org/2275303004/diff/20001/ios/web/public/test/web_view_interaction_test_util.mm File ios/web/public/test/web_view_interaction_test_util.mm (right): https://codereview.chromium.org/2275303004/diff/20001/ios/web/public/test/web_view_interaction_test_util.mm#newcode11 ios/web/public/test/web_view_interaction_test_util.mm:11: #include "ios/testing/earl_grey/wait_util.h" Just an FYI. I am working on ...
4 years, 3 months ago (2016-08-31 05:27:02 UTC) #7
marq (ping after 24h)
Thanks for the fast and thorough feedback! PTAL. https://codereview.chromium.org/2275303004/diff/20001/ios/testing/earl_grey/matchers.h File ios/testing/earl_grey/matchers.h (right): https://codereview.chromium.org/2275303004/diff/20001/ios/testing/earl_grey/matchers.h#newcode15 ios/testing/earl_grey/matchers.h:15: id<GREYMatcher> ...
4 years, 3 months ago (2016-08-31 13:07:59 UTC) #8
Eugene But (OOO till 7-30)
lgtm with fixing references capturing inside the blocks https://codereview.chromium.org/2275303004/diff/20001/ios/web/public/test/earl_grey/web_view_matchers.h File ios/web/public/test/earl_grey/web_view_matchers.h (right): https://codereview.chromium.org/2275303004/diff/20001/ios/web/public/test/earl_grey/web_view_matchers.h#newcode8 ios/web/public/test/earl_grey/web_view_matchers.h:8: #import ...
4 years, 3 months ago (2016-08-31 15:28:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2275303004/60001
4 years, 3 months ago (2016-08-31 16:20:37 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-08-31 17:24:10 UTC) #18
commit-bot: I haz the power
4 years, 3 months ago (2016-08-31 17:26:23 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/c73c7bef14788c1bce67f5ebe896d55108175c5b
Cr-Commit-Position: refs/heads/master@{#415670}

Powered by Google App Engine
This is Rietveld 408576698