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