Commit dcb7c8ab authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes UKMTestCase when UIRefresh is enabled.

BUG=818732

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ie1639a9112b16aeade373449e75934c8e63fedb7
Reviewed-on: https://chromium-review.googlesource.com/1027900
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553667}
parent 5e2d9bc8
......@@ -176,6 +176,7 @@ source_set("eg_tests") {
"//ios/chrome/browser/ui/authentication:eg_test_support",
"//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/tab_switcher:egtest_support",
"//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",
......
......@@ -15,6 +15,7 @@
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_mode.h"
#include "ios/chrome/browser/ui/ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h"
......@@ -162,7 +163,16 @@ void CloseCurrentIncognitoTab() {
void CloseAllIncognitoTabs() {
GREYAssert(chrome_test_util::CloseAllIncognitoTabs(), @"Tabs did not close");
[ChromeEarlGrey waitForIncognitoTabCount:0];
if (IsIPadIdiom()) {
// When the tablet tab switcher is enabled, the user is dropped into the tab
// switcher after closing the last incognito tab. Therefore this test must
// manually switch back to showing the normal tabs. The stackview and tabgrid
// show the normal tabs immediately, without entering the switcher, so when
// those are enabled this step is not necessary.
//
// TODO(crbug.com/836812): This may need to include GRID as well, depending on
// how Issue 836812 is resolved.
if (GetTabSwitcherMode() == TabSwitcherMode::TABLET_SWITCHER) {
// Switch to the non-incognito panel and leave the tab switcher.
[[EarlGrey selectElementWithMatcher:TabletTabSwitcherOpenTabsPanelButton()]
performAction:grey_tap()];
......
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