Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: chrome/test/ui/ui_test.cc

Issue 92001: Restore closed tabs into new windows when necessary, and track the windows th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_test.cc
===================================================================
--- chrome/test/ui/ui_test.cc (revision 14184)
+++ chrome/test/ui/ui_test.cc (working copy)
@@ -458,8 +458,14 @@
#endif
}
-TabProxy* UITest::GetActiveTab() {
- scoped_ptr<BrowserProxy> window_proxy(automation()->GetBrowserWindow(0));
+TabProxy* UITest::GetActiveTab(int window_index) {
+ EXPECT_GE(window_index, 0);
+ int window_count;
+ // Use EXPECT rather than ASSERT here because ASSERT_* returns void.
+ EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ EXPECT_GT(window_count, window_index);
+ scoped_ptr<BrowserProxy> window_proxy(automation()->
+ GetBrowserWindow(window_index));
if (!window_proxy.get())
return NULL;
@@ -545,8 +551,8 @@
}
#endif // defined(OS_WIN)
-GURL UITest::GetActiveTabURL() {
- scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
+GURL UITest::GetActiveTabURL(int window_index) {
+ scoped_ptr<TabProxy> tab_proxy(GetActiveTab(window_index));
if (!tab_proxy.get())
return GURL();
@@ -556,9 +562,9 @@
return url;
}
-std::wstring UITest::GetActiveTabTitle() {
+std::wstring UITest::GetActiveTabTitle(int window_index) {
std::wstring title;
- scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
+ scoped_ptr<TabProxy> tab_proxy(GetActiveTab(window_index));
if (!tab_proxy.get())
return title;
@@ -566,8 +572,8 @@
return title;
}
-int UITest::GetActiveTabIndex() {
- scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
+int UITest::GetActiveTabIndex(int window_index) {
+ scoped_ptr<TabProxy> tab_proxy(GetActiveTab(window_index));
if (!tab_proxy.get())
return -1;
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698