diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 13:28:24 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 13:28:24 +0000 |
commit | fbc947b9ed8df318710ca92e7341d327784c6808 (patch) | |
tree | 18465ec253dc9eaed4e3fd8c78e9a9f7f6f40a14 /chrome/browser/tab_restore_uitest.cc | |
parent | ef42ecf401127e5ea585c9d4b7b82ba9eda506f0 (diff) | |
download | chromium_src-fbc947b9ed8df318710ca92e7341d327784c6808.zip chromium_src-fbc947b9ed8df318710ca92e7341d327784c6808.tar.gz chromium_src-fbc947b9ed8df318710ca92e7341d327784c6808.tar.bz2 |
Implement restoring closed tab menu item. Reworked cross-platform code to handle the case of restoring when there are no browsers open by making window restore re-use a given browser if it has no tabs. Removed unit test that assumes it can pass a NULL Browser. Wrote a new UI test to cover the same area, but it's disabled until another bug is fixed, and I didn't want to hold up landing this feature. Added key shortcut for "open window in incognito mode".
BUG=13758
TEST=restoring closed tabs with visible windows and with no windows remaining open.
Review URL: http://codereview.chromium.org/125257
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_restore_uitest.cc')
-rw-r--r-- | chrome/browser/tab_restore_uitest.cc | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc index 5807721..5535124 100644 --- a/chrome/browser/tab_restore_uitest.cc +++ b/chrome/browser/tab_restore_uitest.cc @@ -282,9 +282,46 @@ TEST_F(TabRestoreUITest, BasicRestoreFromClosedWindow) { EXPECT_EQ(url1_, GetActiveTabURL(1)); } +// Restore a tab then make sure it doesn't restore again. +// Disabled because the command updater doesn't know the proper state of +// the tab restore command. http://crbug.com/14428. +TEST_F(TabRestoreUITest, DISABLED_DontLoadRestoredTab) { + scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); + CheckActiveWindow(browser_proxy.get()); + + // Add two tabs + int starting_tab_count = 0; + ASSERT_TRUE(browser_proxy->GetTabCount(&starting_tab_count)); + AddSomeTabs(browser_proxy.get(), 2); + int current_tab_count = 0; + ASSERT_TRUE(browser_proxy->GetTabCount(¤t_tab_count)); + ASSERT_EQ(current_tab_count, starting_tab_count + 2); + + // Close one of them. + scoped_refptr<TabProxy> tab_to_close(browser_proxy->GetTab(0)); + tab_to_close->Close(true); + ASSERT_TRUE(browser_proxy->GetTabCount(¤t_tab_count)); + ASSERT_EQ(current_tab_count, starting_tab_count + 1); + + // Restore it. + RestoreTab(0, 0); + ASSERT_TRUE(browser_proxy->GetTabCount(¤t_tab_count)); + ASSERT_EQ(current_tab_count, starting_tab_count + 2); + + // Make sure that there's nothing else to restore. + // TODO(pinkerton): This currently fails because the command_updater in the + // always says yes. See bug above. + bool is_timeout = false; + bool enabled = + browser_proxy->IsPageMenuCommandEnabledWithTimeout(IDC_RESTORE_TAB, + action_max_timeout_ms(), &is_timeout); + if (!is_timeout) + ASSERT_FALSE(enabled); +} + // Open a window with multiple tabs, close a tab, then close the window. // Restore both and make sure the tab goes back into the window. -// Disabled because flacky. See http://crbug.com/14132 +// Disabled because flakey. See http://crbug.com/14132 TEST_F(TabRestoreUITest, DISABLED_RestoreWindowAndTab) { scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); CheckActiveWindow(browser_proxy.get()); |