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

Side by Side Diff: ios/chrome/test/earl_grey/chrome_util.mm

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/chrome/test/earl_grey/chrome_util.h"
6
7 #import <EarlGrey/EarlGrey.h>
8
9 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h"
10 #import "ios/chrome/test/app/chrome_test_util.h"
11 #import "ios/testing/wait_util.h"
12 #import "ios/web/public/test/earl_grey/web_view_matchers.h"
13
14 namespace {
15 const NSTimeInterval kWaitForToolbarAnimationTimeout = 1.0;
16 } // namespace
17
18 namespace chrome_test_util {
19
20 void AssertToolbarNotVisible() {
21 ConditionBlock condition = ^{
22 id<GREYMatcher> toolsMenuButton =
23 grey_allOf(grey_accessibilityID(kToolbarToolsMenuButtonIdentifier),
24 grey_sufficientlyVisible(), nil);
25 NSError* error = nil;
26 [[EarlGrey selectElementWithMatcher:toolsMenuButton]
27 assertWithMatcher:grey_notNil()
28 error:&error];
29 return error != nil;
30 };
31 GREYAssert(testing::WaitUntilConditionOrTimeout(
32 kWaitForToolbarAnimationTimeout, condition),
33 @"The toolbar is still visible.");
34 }
35
36 void AssertToolbarVisible() {
37 ConditionBlock condition = ^{
38 id<GREYMatcher> toolsMenuButton =
39 grey_allOf(grey_accessibilityID(kToolbarToolsMenuButtonIdentifier),
40 grey_sufficientlyVisible(), nil);
41 NSError* error = nil;
42 [[EarlGrey selectElementWithMatcher:toolsMenuButton]
43 assertWithMatcher:grey_notNil()
44 error:&error];
45 return error == nil;
46 };
47 GREYAssert(testing::WaitUntilConditionOrTimeout(
48 kWaitForToolbarAnimationTimeout, condition),
49 @"The toolbar is not visible.");
50 }
51
52 } // namespace chrome_test_util
OLDNEW
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_util.h ('k') | ios/chrome/test/earl_grey/device_check_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698