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

Side by Side Diff: ios/chrome/browser/context_menu/context_menu_egtest.mm

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: better formatting Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <EarlGrey/EarlGrey.h> 5 #import <EarlGrey/EarlGrey.h>
6 #import <UIKit/UIKit.h> 6 #import <UIKit/UIKit.h>
7 #import <XCTest/XCTest.h> 7 #import <XCTest/XCTest.h>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "ios/chrome/browser/ui/ui_util.h" 10 #include "ios/chrome/browser/ui/ui_util.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // TODO(crbug.com/702272): Try to replace this with one EarlGrey method call. 217 // TODO(crbug.com/702272): Try to replace this with one EarlGrey method call.
218 [[EarlGrey 218 [[EarlGrey
219 selectElementWithMatcher:WebViewScrollView( 219 selectElementWithMatcher:WebViewScrollView(
220 chrome_test_util::GetCurrentWebState())] 220 chrome_test_util::GetCurrentWebState())]
221 performAction:grey_swipeFastInDirection(kGREYDirectionUp)]; 221 performAction:grey_swipeFastInDirection(kGREYDirectionUp)];
222 [[EarlGrey 222 [[EarlGrey
223 selectElementWithMatcher:WebViewScrollView( 223 selectElementWithMatcher:WebViewScrollView(
224 chrome_test_util::GetCurrentWebState())] 224 chrome_test_util::GetCurrentWebState())]
225 performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)]; 225 performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
226 226
227 [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText( 227 [ChromeEarlGrey
228 kDestinationLinkID)] 228 waitForWebViewContainingText:base::SysUTF8ToNSString(kDestinationLinkID)];
229 assertWithMatcher:grey_notNil()];
230 229
231 LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton()); 230 LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton());
232 231
233 // Earl Grey cannot preperly synchronize some animations, so adding a 232 // Earl Grey cannot preperly synchronize some animations, so adding a
234 // WaitUntilCondition to wait for the new tab opening animation to finish 233 // WaitUntilCondition to wait for the new tab opening animation to finish
235 // and the scroll view to become interactable. 234 // and the scroll view to become interactable.
236 ConditionBlock condition = ^{ 235 ConditionBlock condition = ^{
237 NSError* error = nil; 236 NSError* error = nil;
238 [[EarlGrey 237 [[EarlGrey
239 selectElementWithMatcher:WebViewScrollView( 238 selectElementWithMatcher:WebViewScrollView(
(...skipping 17 matching lines...) Expand all
257 SelectTabAtIndexInCurrentMode(1U); 256 SelectTabAtIndexInCurrentMode(1U);
258 257
259 // Verify url and tab count. 258 // Verify url and tab count.
260 [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText( 259 [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
261 destinationURL.GetContent())] 260 destinationURL.GetContent())]
262 assertWithMatcher:grey_notNil()]; 261 assertWithMatcher:grey_notNil()];
263 chrome_test_util::AssertMainTabCount(2U); 262 chrome_test_util::AssertMainTabCount(2U);
264 } 263 }
265 264
266 @end 265 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698