Commit 33419b69 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Disables the StackView egtests when the StackView is not enabled.

BUG=825431

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I95f5f986900aa31f4a484a36c0fbd789cf2b3c5e
Reviewed-on: https://chromium-review.googlesource.com/995916Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548116}
parent 76542a3e
......@@ -128,6 +128,7 @@ source_set("eg_tests") {
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/tabs",
"//ios/chrome/browser/ui:ui_internal",
"//ios/chrome/browser/ui/tab_switcher:modes",
"//ios/chrome/browser/ui/toolbar/buttons",
"//ios/chrome/browser/ui/toolbar/legacy",
"//ios/chrome/browser/ui/toolbar/public",
......
......@@ -16,6 +16,7 @@
#import "ios/chrome/browser/ui/stack_view/card_view.h"
#import "ios/chrome/browser/ui/stack_view/stack_view_controller.h"
#import "ios/chrome/browser/ui/stack_view/stack_view_controller_private.h"
#include "ios/chrome/browser/ui/tab_switcher/tab_switcher_mode.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_constants.h"
#import "ios/chrome/browser/ui/toolbar/legacy/toolbar_controller_constants.h"
#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h"
......@@ -187,9 +188,11 @@ void SelectTabUsingStackView(Tab* tab) {
// Switches between three Tabs via the stack view.
- (void)testSwitchTabs {
// The StackViewController is only used on iPhones.
if (IsIPadIdiom())
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads.");
if (GetTabSwitcherMode() != TabSwitcherMode::STACK) {
EARL_GREY_TEST_SKIPPED(
@"TabSwitcher tests are not applicable in this configuration");
}
// Open two additional Tabs.
const NSUInteger kAdditionalTabCount = 2;
for (NSUInteger i = 0; i < kAdditionalTabCount; ++i)
......@@ -201,9 +204,11 @@ void SelectTabUsingStackView(Tab* tab) {
// Tests closing a tab in the stack view.
- (void)testCloseTab {
// The StackViewController is only used on iPhones.
if (IsIPadIdiom())
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads.");
if (GetTabSwitcherMode() != TabSwitcherMode::STACK) {
EARL_GREY_TEST_SKIPPED(
@"TabSwitcher tests are not applicable in this configuration");
}
// Open the stack view and tap the close button on the current CardView.
OpenStackView();
StackViewController* stackViewController =
......@@ -223,9 +228,11 @@ void SelectTabUsingStackView(Tab* tab) {
// Tests closing all Tabs in the stack view.
- (void)testCloseAllTabs {
// The StackViewController is only used on iPhones.
if (IsIPadIdiom())
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads.");
if (GetTabSwitcherMode() != TabSwitcherMode::STACK) {
EARL_GREY_TEST_SKIPPED(
@"TabSwitcher tests are not applicable in this configuration");
}
// Open an incognito Tab.
OpenNewIncognitoTabUsingStackView();
GREYAssertEqual(chrome_test_util::GetIncognitoTabCount(), 1,
......@@ -268,9 +275,11 @@ void SelectTabUsingStackView(Tab* tab) {
// Tests that tapping on the inactive deck region switches modes.
- (void)testSwitchingModes {
// The StackViewController is only used on iPhones.
if (IsIPadIdiom())
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads.");
if (GetTabSwitcherMode() != TabSwitcherMode::STACK) {
EARL_GREY_TEST_SKIPPED(
@"TabSwitcher tests are not applicable in this configuration");
}
// Open an Incognito Tab then switch decks.
OpenNewIncognitoTabUsingStackView();
ShowDeckWithType(DeckType::INCOGNITO);
......@@ -288,9 +297,10 @@ void SelectTabUsingStackView(Tab* tab) {
// Tests that closing a Tab that has a queued dialog successfully cancels the
// dialog.
- (void)testCloseTabWithDialog {
// The StackViewController is only used on iPhones.
if (IsIPadIdiom())
EARL_GREY_TEST_SKIPPED(@"Stack view is not used on iPads.");
if (GetTabSwitcherMode() != TabSwitcherMode::STACK) {
EARL_GREY_TEST_SKIPPED(
@"TabSwitcher tests are not applicable in this configuration");
}
// Load the blank test page so that JavaScript can be executed.
const GURL kBlankPageURL = HttpServer::MakeUrl("http://blank-page");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment