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

Unified Diff: chrome/browser/tab_restore_uitest.cc

Issue 11377: Changes tab restore service to handle restoring closed windows as a... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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/browser/tab_restore_service.cc ('k') | chrome/test/automation/browser_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_restore_uitest.cc
===================================================================
--- chrome/browser/tab_restore_uitest.cc (revision 5928)
+++ chrome/browser/tab_restore_uitest.cc (working copy)
@@ -170,7 +170,6 @@
ASSERT_EQ(http_url1, GetActiveTabURL());
}
-
// Tests that the SiteInstances used for entries in a restored tab's history
// are given appropriate max page IDs, even if the renderer for the entry
// already exists. (Bug 1204135)
@@ -222,3 +221,56 @@
ASSERT_EQ(http_url2, GetActiveTabURL());
}
+TEST_F(TabRestoreUITest, RestoreWindow) {
+ // Create a new window.
+ int window_count;
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ ASSERT_TRUE(automation()->OpenNewBrowserWindow(SW_HIDE));
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(++window_count,
+ kWaitForActionMaxMsec));
+
+ // Create two more tabs, one with url1, the other url2.
+ scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
+ int initial_tab_count;
+ ASSERT_TRUE(browser_proxy->GetTabCount(&initial_tab_count));
+ browser_proxy->AppendTab(url1_);
+ ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 1,
+ kWaitForActionMaxMsec));
+ scoped_ptr<TabProxy> new_tab(browser_proxy->GetTab(initial_tab_count));
+ new_tab->NavigateToURL(url1_);
+ browser_proxy->AppendTab(url2_);
+ ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 2,
+ kWaitForActionMaxMsec));
+ new_tab.reset(browser_proxy->GetTab(initial_tab_count + 1));
+ new_tab->NavigateToURL(url2_);
+
+ // Close the window.
+ ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_CLOSEWINDOW));
+ browser_proxy.reset();
+ new_tab.reset();
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(window_count - 1,
+ kWaitForActionMaxMsec));
+
+ // Restore the window.
+ browser_proxy.reset(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_RESTORE_TAB));
+ ASSERT_TRUE(automation()->WaitForWindowCountToBecome(window_count,
+ kWaitForActionMaxMsec));
+
+ browser_proxy.reset(automation()->GetBrowserWindow(1));
+ ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 2,
+ kWaitForActionMaxMsec));
+
+ scoped_ptr<TabProxy> restored_tab_proxy(
+ browser_proxy->GetTab(initial_tab_count));
+ ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec));
+ GURL url;
+ ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url));
+ ASSERT_TRUE(url == url1_);
+
+ restored_tab_proxy.reset(
+ browser_proxy->GetTab(initial_tab_count + 1));
+ ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec));
+ ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url));
+ ASSERT_TRUE(url == url2_);
+}
« no previous file with comments | « chrome/browser/tab_restore_service.cc ('k') | chrome/test/automation/browser_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698