Commit 9075529d authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Fix TabUsageRecorder:testOpenLinkInNewTab

Use standard way to select tab.

Bug: None
Change-Id: I531a3e450d93c860b62f8896379e8097d7b1f622
Reviewed-on: https://chromium-review.googlesource.com/684438Reviewed-by: default avatarElodie Banel <lod@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504347}
parent 99e3e3dd
...@@ -132,16 +132,6 @@ void CloseTabAtIndexAndSync(NSUInteger i) { ...@@ -132,16 +132,6 @@ void CloseTabAtIndexAndSync(NSUInteger i) {
testing::WaitUntilConditionOrTimeout(kWaitElementTimeout, condition), testing::WaitUntilConditionOrTimeout(kWaitElementTimeout, condition),
@"Waiting for tab to close"); @"Waiting for tab to close");
} }
// Select the tab with title |title| using UI (tab strip on iPad, stack view on
// iPhone).
void SelectTabUsingUI(NSString* title) {
if (IsCompact()) {
WaitAndTap(chrome_test_util::ShowTabsButton(), @"Tab switcher");
}
WaitAndTap(grey_text(title),
[NSString stringWithFormat:@"tab with title %@", title]);
}
} // namespace } // namespace
// Test for the TabUsageRecorder class. // Test for the TabUsageRecorder class.
...@@ -700,7 +690,7 @@ void SelectTabUsingUI(NSString* title) { ...@@ -700,7 +690,7 @@ void SelectTabUsingUI(NSString* title) {
performAction:grey_tap()]; performAction:grey_tap()];
[ChromeEarlGrey waitForMainTabCount:(numberOfTabs + 1)]; [ChromeEarlGrey waitForMainTabCount:(numberOfTabs + 1)];
SelectTabUsingUI(base::SysUTF8ToNSString(destinationURL.GetContent())); chrome_test_util::SelectTabAtIndexInCurrentMode(numberOfTabs);
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
[ChromeEarlGrey waitForWebViewContainingText:"Whee"]; [ChromeEarlGrey waitForWebViewContainingText:"Whee"];
......
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