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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 // And make sure everything looks right. | 194 // And make sure everything looks right. |
195 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); | 195 ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); |
196 EXPECT_EQ(starting_tab_count + 3, tab_count); | 196 EXPECT_EQ(starting_tab_count + 3, tab_count); |
197 EXPECT_EQ(closed_tab_index, GetActiveTabIndex()); | 197 EXPECT_EQ(closed_tab_index, GetActiveTabIndex()); |
198 EXPECT_EQ(url1_, GetActiveTabURL()); | 198 EXPECT_EQ(url1_, GetActiveTabURL()); |
199 } | 199 } |
200 | 200 |
201 // Close a tab, switch windows, then restore the tab. The tab should be in its | 201 // Close a tab, switch windows, then restore the tab. The tab should be in its |
202 // original window and position, and active. | 202 // original window and position, and active. |
203 // Disabled because flacky. See http://crbug.com/14132 and 11213. | 203 // This test is flaky. See http://crbug.com/14132 and 11213. |
204 TEST_F(TabRestoreUITest, DISABLED_RestoreToDifferentWindow) { | 204 TEST_F(TabRestoreUITest, FLAKY_RestoreToDifferentWindow) { |
205 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 205 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
206 | 206 |
207 // This call is virtually guaranteed to pass, assuming that Chromium is the | 207 // This call is virtually guaranteed to pass, assuming that Chromium is the |
208 // active application, which will establish a baseline for later calls to | 208 // active application, which will establish a baseline for later calls to |
209 // CheckActiveWindow(). See comments in that function. | 209 // CheckActiveWindow(). See comments in that function. |
210 CheckActiveWindow(browser_proxy.get()); | 210 CheckActiveWindow(browser_proxy.get()); |
211 | 211 |
212 int starting_tab_count; | 212 int starting_tab_count; |
213 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); | 213 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); |
214 int tab_count = AddSomeTabs(browser_proxy.get(), 3); | 214 int tab_count = AddSomeTabs(browser_proxy.get(), 3); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 bool is_timeout = false; | 329 bool is_timeout = false; |
330 bool enabled = | 330 bool enabled = |
331 browser_proxy->IsPageMenuCommandEnabledWithTimeout(IDC_RESTORE_TAB, | 331 browser_proxy->IsPageMenuCommandEnabledWithTimeout(IDC_RESTORE_TAB, |
332 action_max_timeout_ms(), &is_timeout); | 332 action_max_timeout_ms(), &is_timeout); |
333 if (!is_timeout) | 333 if (!is_timeout) |
334 ASSERT_FALSE(enabled); | 334 ASSERT_FALSE(enabled); |
335 } | 335 } |
336 | 336 |
337 // Open a window with multiple tabs, close a tab, then close the window. | 337 // Open a window with multiple tabs, close a tab, then close the window. |
338 // Restore both and make sure the tab goes back into the window. | 338 // Restore both and make sure the tab goes back into the window. |
339 // Disabled because flakey. See http://crbug.com/14132 | 339 // This test is flaky. See http://crbug.com/14132 |
340 TEST_F(TabRestoreUITest, DISABLED_RestoreWindowAndTab) { | 340 TEST_F(TabRestoreUITest, FLAKY_RestoreWindowAndTab) { |
341 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 341 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
342 CheckActiveWindow(browser_proxy.get()); | 342 CheckActiveWindow(browser_proxy.get()); |
343 | 343 |
344 int starting_tab_count; | 344 int starting_tab_count; |
345 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); | 345 ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); |
346 int tab_count = AddSomeTabs(browser_proxy.get(), 3); | 346 int tab_count = AddSomeTabs(browser_proxy.get(), 3); |
347 | 347 |
348 // Close one in the middle | 348 // Close one in the middle |
349 int closed_tab_index = starting_tab_count + 1; | 349 int closed_tab_index = starting_tab_count + 1; |
350 scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index)); | 350 scoped_refptr<TabProxy> new_tab(browser_proxy->GetTab(closed_tab_index)); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 GURL url; | 595 GURL url; |
596 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 596 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
597 EXPECT_TRUE(url == url1_); | 597 EXPECT_TRUE(url == url1_); |
598 | 598 |
599 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); | 599 restored_tab_proxy = browser_proxy->GetTab(initial_tab_count + 1); |
600 ASSERT_TRUE(restored_tab_proxy.get()); | 600 ASSERT_TRUE(restored_tab_proxy.get()); |
601 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); | 601 ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); |
602 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); | 602 ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); |
603 EXPECT_TRUE(url == url2_); | 603 EXPECT_TRUE(url == url2_); |
604 } | 604 } |
OLD | NEW |