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

Unified Diff: ios/chrome/browser/context_menu/context_menu_egtest.mm

Issue 2752153004: Fix testContextMenuOpenInNewTabFromTallPage. (Closed)
Patch Set: remove debugging code Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/context_menu/context_menu_egtest.mm
diff --git a/ios/chrome/browser/context_menu/context_menu_egtest.mm b/ios/chrome/browser/context_menu/context_menu_egtest.mm
index 3e021534098550e68294ad48c4449e43f494ca20..f65f1cf156085adfcbd5b399a1508e3479763355 100644
--- a/ios/chrome/browser/context_menu/context_menu_egtest.mm
+++ b/ios/chrome/browser/context_menu/context_menu_egtest.mm
@@ -189,9 +189,7 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
// Tests "Open in New Tab" on context menu on a link that requires scrolling
// on the page to verify that context menu can be properly triggered in the
// current screen view.
-// TODO(crbug.com/701104): This test is flaky because sometimes it doesn't
-// scroll down far enough for the link to be visible.
-- (void)FLAKY_testContextMenuOpenInNewTabFromTallPage {
+- (void)testContextMenuOpenInNewTabFromTallPage {
// Set up test simple http server.
std::map<GURL, std::string> responses;
GURL initialURL =
@@ -211,10 +209,19 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
chrome_test_util::AssertMainTabCount(1U);
// Scroll down on the web view to make the link visible.
+ // grey_swipeFastInDirecton will quickly scroll towards the bottom, and then
+ // grey_scrollToContentEdge guarantees the content edge is reached. Two
+ // methods are used because the first one is much faster, but doesn't
+ // guarantee the link becomes visible.
[[EarlGrey
selectElementWithMatcher:WebViewScrollView(
chrome_test_util::GetCurrentWebState())]
performAction:grey_swipeFastInDirection(kGREYDirectionUp)];
+ [[EarlGrey
+ selectElementWithMatcher:WebViewScrollView(
+ chrome_test_util::GetCurrentWebState())]
+ performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
Eugene But (OOO till 7-30) 2017/03/16 16:54:52 It's pretty bad that |grey_scrollToContentEdge| is
baxley 2017/03/16 17:05:14 Done. Yeah, I agree that it's so slow. For a lot o
+
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
kDestinationLinkID)]
assertWithMatcher:grey_notNil()];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698