OLD | NEW |
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 <XCTest/XCTest.h> | 5 #import <XCTest/XCTest.h> |
6 | 6 |
7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #import "base/test/ios/wait_util.h" | 10 #import "base/test/ios/wait_util.h" |
11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
12 #include "ios/chrome/browser/pref_names.h" | 12 #include "ios/chrome/browser/pref_names.h" |
13 #import "ios/chrome/browser/tabs/tab.h" | 13 #import "ios/chrome/browser/tabs/tab.h" |
14 #import "ios/chrome/browser/tabs/tab_model.h" | 14 #import "ios/chrome/browser/tabs/tab_model.h" |
15 #import "ios/chrome/browser/ui/browser_view_controller.h" | 15 #import "ios/chrome/browser/ui/browser_view_controller.h" |
16 #import "ios/chrome/browser/ui/stack_view/card_view.h" | 16 #import "ios/chrome/browser/ui/stack_view/card_view.h" |
17 #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h" | 17 #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h" |
18 #import "ios/chrome/browser/ui/stack_view/stack_view_controller_private.h" | 18 #import "ios/chrome/browser/ui/stack_view/stack_view_controller_private.h" |
19 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" | 19 #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" |
20 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" | 20 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" |
21 #import "ios/chrome/test/app/stack_view_test_util.h" | 21 #import "ios/chrome/test/app/stack_view_test_util.h" |
22 #import "ios/chrome/test/app/tab_test_util.h" | 22 #import "ios/chrome/test/app/tab_test_util.h" |
23 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" | 23 #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" |
24 #import "ios/chrome/test/earl_grey/chrome_matchers.h" | 24 #import "ios/chrome/test/earl_grey/chrome_matchers.h" |
25 #import "ios/chrome/test/earl_grey/chrome_test_case.h" | 25 #import "ios/chrome/test/earl_grey/chrome_test_case.h" |
26 #include "ios/testing/earl_grey/disabled_test_macros.h" | 26 #include "ios/testing/earl_grey/disabled_test_macros.h" |
27 | 27 |
| 28 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 29 #error "This file requires ARC support." |
| 30 #endif |
| 31 |
28 namespace { | 32 namespace { |
29 // Returns a GREYMatcher that matches |view|. | 33 // Returns a GREYMatcher that matches |view|. |
30 // TODO(crbug.com/642619): Evaluate whether this should be shared code. | 34 // TODO(crbug.com/642619): Evaluate whether this should be shared code. |
31 id<GREYMatcher> ViewMatchingView(UIView* view) { | 35 id<GREYMatcher> ViewMatchingView(UIView* view) { |
32 MatchesBlock matches = ^BOOL(UIView* viewToMatch) { | 36 MatchesBlock matches = ^BOOL(UIView* viewToMatch) { |
33 return viewToMatch == view; | 37 return viewToMatch == view; |
34 }; | 38 }; |
35 DescribeToBlock describe = ^void(id<GREYDescription> description) { | 39 DescribeToBlock describe = ^void(id<GREYDescription> description) { |
36 NSString* matcherDescription = | 40 NSString* matcherDescription = |
37 [NSString stringWithFormat:@"View matching %@", view]; | 41 [NSString stringWithFormat:@"View matching %@", view]; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 chrome_test_util::GetStackViewController(); | 244 chrome_test_util::GetStackViewController(); |
241 GREYAssert([stackViewController isCurrentSetIncognito], | 245 GREYAssert([stackViewController isCurrentSetIncognito], |
242 @"Incognito deck not selected."); | 246 @"Incognito deck not selected."); |
243 // Switch back to the main CardSet and verify that is selected. | 247 // Switch back to the main CardSet and verify that is selected. |
244 ShowDeckWithType(DeckType::NORMAL); | 248 ShowDeckWithType(DeckType::NORMAL); |
245 GREYAssert(![stackViewController isCurrentSetIncognito], | 249 GREYAssert(![stackViewController isCurrentSetIncognito], |
246 @"Normal deck not selected."); | 250 @"Normal deck not selected."); |
247 } | 251 } |
248 | 252 |
249 @end | 253 @end |
OLD | NEW |