| Index: ios/chrome/test/app/stack_view_test_util.mm
|
| diff --git a/ios/chrome/test/app/stack_view_test_util.mm b/ios/chrome/test/app/stack_view_test_util.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..da74034976f00b00b20be8f3e36836797025eb4a
|
| --- /dev/null
|
| +++ b/ios/chrome/test/app/stack_view_test_util.mm
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#import "ios/chrome/test/app/stack_view_test_util.h"
|
| +
|
| +#import "base/mac/foundation_util.h"
|
| +#import "ios/chrome/app/main_controller.h"
|
| +#import "ios/chrome/app/main_controller_private.h"
|
| +#import "ios/chrome/browser/ui/stack_view/stack_view_controller.h"
|
| +#import "ios/chrome/test/app/chrome_test_util.h"
|
| +#import "ios/chrome/test/app/tab_test_util.h"
|
| +
|
| +namespace chrome_test_util {
|
| +
|
| +bool IsTabSwitcherActive() {
|
| + return [chrome_test_util::GetMainController() isTabSwitcherActive];
|
| +}
|
| +
|
| +StackViewController* GetStackViewController() {
|
| + if (!IsTabSwitcherActive())
|
| + return nil;
|
| + MainController* mainController = chrome_test_util::GetMainController();
|
| + DCHECK(mainController);
|
| + return base::mac::ObjCCastStrict<StackViewController>(
|
| + [mainController tabSwitcherController]);
|
| +}
|
| +
|
| +} // namespace chrome_test_util
|
|
|