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 "ios/chrome/test/app/stack_view_test_util.h" | 5 #import "ios/chrome/test/app/stack_view_test_util.h" |
6 | 6 |
7 #import "base/mac/foundation_util.h" | 7 #import "base/mac/foundation_util.h" |
8 #import "ios/chrome/app/main_controller.h" | 8 #import "ios/chrome/app/main_controller.h" |
9 #import "ios/chrome/app/main_controller_private.h" | 9 #import "ios/chrome/app/main_controller_private.h" |
10 #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h" | 10 #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h" |
11 #import "ios/chrome/test/app/chrome_test_util.h" | 11 #import "ios/chrome/test/app/chrome_test_util.h" |
12 #import "ios/chrome/test/app/tab_test_util.h" | 12 #import "ios/chrome/test/app/tab_test_util.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 namespace chrome_test_util { | 18 namespace chrome_test_util { |
15 | 19 |
16 bool IsTabSwitcherActive() { | 20 bool IsTabSwitcherActive() { |
17 return [chrome_test_util::GetMainController() isTabSwitcherActive]; | 21 return [chrome_test_util::GetMainController() isTabSwitcherActive]; |
18 } | 22 } |
19 | 23 |
20 StackViewController* GetStackViewController() { | 24 StackViewController* GetStackViewController() { |
21 if (!IsTabSwitcherActive()) | 25 if (!IsTabSwitcherActive()) |
22 return nil; | 26 return nil; |
23 MainController* mainController = chrome_test_util::GetMainController(); | 27 MainController* mainController = chrome_test_util::GetMainController(); |
24 DCHECK(mainController); | 28 DCHECK(mainController); |
25 return base::mac::ObjCCastStrict<StackViewController>( | 29 return base::mac::ObjCCastStrict<StackViewController>( |
26 [mainController tabSwitcherController]); | 30 [mainController tabSwitcherController]); |
27 } | 31 } |
28 | 32 |
29 } // namespace chrome_test_util | 33 } // namespace chrome_test_util |
OLD | NEW |