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

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

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 3 years, 12 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
(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_assertions.h"
6
7 #import <EarlGrey/EarlGrey.h>
8
9 #include "base/format_macros.h"
10 #import "ios/chrome/test/app/tab_test_util.h"
11 #import "ios/testing/wait_util.h"
12
13 namespace chrome_test_util {
14
15 void AssertMainTabCount(NSUInteger expected_tab_count) {
16 // Allow the UI to become idle, in case any tabs are being opened or closed.
17 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
18 GREYAssert(testing::WaitUntilConditionOrTimeout(
19 testing::kWaitForUIElementTimeout,
20 ^{
21 return GetMainTabCount() == expected_tab_count;
22 }),
23 [NSString stringWithFormat:@"Did not receive %" PRIuNS " tabs",
24 expected_tab_count]);
25 }
26
27 void AssertIncognitoTabCount(NSUInteger expected_tab_count) {
28 // Allow the UI to become idle, in case any tabs are being opened or closed.
29 [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
30 ConditionBlock condition = ^{
31 return GetIncognitoTabCount() == expected_tab_count;
32 };
33 GREYAssert(
34 testing::WaitUntilConditionOrTimeout(testing::kWaitForUIElementTimeout,
35 condition),
36 [NSString stringWithFormat:@"Did not receive %" PRIuNS " incognito tabs",
37 expected_tab_count]);
38 }
39
40 } // namespace chrome_test_util
OLDNEW
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_assertions.h ('k') | ios/chrome/test/earl_grey/chrome_earl_grey.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698