| 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;
|
|
|
|
|