Chromium Code Reviews| 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()]; |