| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #endif | 10 #endif |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 // And make sure everything looks right. | 184 // And make sure everything looks right. |
| 185 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 185 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
| 186 EXPECT_EQ(starting_tab_count + 3, tab_count); | 186 EXPECT_EQ(starting_tab_count + 3, tab_count); |
| 187 EXPECT_EQ(closed_tab_index, GetActiveTabIndex()); | 187 EXPECT_EQ(closed_tab_index, GetActiveTabIndex()); |
| 188 EXPECT_EQ(url1_, GetActiveTabURL()); | 188 EXPECT_EQ(url1_, GetActiveTabURL()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Close a tab, switch windows, then restore the tab. The tab should be in its | 191 // Close a tab, switch windows, then restore the tab. The tab should be in its |
| 192 // original window and position, and active. | 192 // original window and position, and active. |
| 193 TEST_F(TabRestoreUITest, RestoreToDifferentWindow) { | 193 // Disabled because flacky. See http://crbug.com/14132 |
| 194 TEST_F(TabRestoreUITest, DISABLED_RestoreToDifferentWindow) { |
| 194 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 195 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 195 | 196 |
| 196 // This call is virtually guaranteed to pass, assuming that Chromium is the | 197 // This call is virtually guaranteed to pass, assuming that Chromium is the |
| 197 // active application, which will establish a baseline for later calls to | 198 // active application, which will establish a baseline for later calls to |
| 198 // CheckActiveWindow(). See comments in that function. | 199 // CheckActiveWindow(). See comments in that function. |
| 199 CheckActiveWindow(browser_proxy.get()); | 200 CheckActiveWindow(browser_proxy.get()); |
| 200 | 201 |
| 201 int starting_tab_count; | 202 int starting_tab_count; |
| 202 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); | 203 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); |
| 203 int tab_count = AddSomeTabs(browser_proxy.get(), 3); | 204 int tab_count = AddSomeTabs(browser_proxy.get(), 3); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 CheckActiveWindow(browser_proxy.get()); | 277 CheckActiveWindow(browser_proxy.get()); |
| 277 tab_proxy = browser_proxy->GetActiveTab(); | 278 tab_proxy = browser_proxy->GetActiveTab(); |
| 278 // And make sure the URLs matches. | 279 // And make sure the URLs matches. |
| 279 EXPECT_EQ(url2_, GetActiveTabURL(1)); | 280 EXPECT_EQ(url2_, GetActiveTabURL(1)); |
| 280 EXPECT_TRUE(tab_proxy->GoBack()); | 281 EXPECT_TRUE(tab_proxy->GoBack()); |
| 281 EXPECT_EQ(url1_, GetActiveTabURL(1)); | 282 EXPECT_EQ(url1_, GetActiveTabURL(1)); |
| 282 } | 283 } |
| 283 | 284 |
| 284 // Open a window with multiple tabs, close a tab, then close the window. | 285 // Open a window with multiple tabs, close a tab, then close the window. |
| 285 // Restore both and make sure the tab goes back into the window. | 286 // Restore both and make sure the tab goes back into the window. |
| 286 TEST_F(TabRestoreUITest, RestoreWindowAndTab) { | 287 // Disabled because flacky. See http://crbug.com/14132 |
| 288 TEST_F(TabRestoreUITest, DISABLED_RestoreWindowAndTab) { |
| 287 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 289 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 288 CheckActiveWindow(browser_proxy.get()); | 290 CheckActiveWindow(browser_proxy.get()); |
| 289 | 291 |
| 290 int starting_tab_count; | 292 int starting_tab_count; |
| 291 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); | 293 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); |
| 292 int tab_count = AddSomeTabs(browser_proxy.get(), 3); | 294 int tab_count = AddSomeTabs(browser_proxy.get(), 3); |
| 293 | 295 |
| 294 // Close one in the middle | 296 // Close one in the middle |
| 295 int closed_tab_index = starting_tab_count + 1; | 297 int closed_tab_index = starting_tab_count + 1; |
| 296 scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index)); | 298 scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index)); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 531 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
| 530 GURL url; | 532 GURL url; |
| 531 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 533 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
| 532 EXPECT_TRUE(url == url1_); | 534 EXPECT_TRUE(url == url1_); |
| 533 | 535 |
| 534 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); | 536 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); |
| 535 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 537 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
| 536 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 538 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
| 537 EXPECT_TRUE(url == url2_); | 539 EXPECT_TRUE(url == url2_); |
| 538 } | 540 } |
| OLD | NEW |