diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 20:34:57 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-26 20:34:57 +0000 |
commit | fedaa7dbb468ff581f0a7d30d2410da15363d359 (patch) | |
tree | dd7228cfa6b299c50565c40c65d8413537b1e872 /chrome/browser/sessions | |
parent | 6cbd5041c46c5b6e9e528e18ad1a6f612c27db30 (diff) | |
download | chromium_src-fedaa7dbb468ff581f0a7d30d2410da15363d359.zip chromium_src-fedaa7dbb468ff581f0a7d30d2410da15363d359.tar.gz chromium_src-fedaa7dbb468ff581f0a7d30d2410da15363d359.tar.bz2 |
Fixes flakiness in session restore test. I'm adding two things:
. Make the newly created popup navigate to a url. Without this session
restore won't restore the tab.
. Before exiting manually shutdown the session service. Without this
the windows are closed, which, depending upon timing, is treated as
though the user closed the window so that session restore won't
restore the window.
BUG=32716
TEST=this is only a test fix
Review URL: http://codereview.chromium.org/552134
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sessions')
-rw-r--r-- | chrome/browser/sessions/session_restore_uitest.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc index ec4c8bc..a1eaa4a 100644 --- a/chrome/browser/sessions/session_restore_uitest.cc +++ b/chrome/browser/sessions/session_restore_uitest.cc @@ -86,13 +86,6 @@ class SessionRestoreUITest : public UITest { DISALLOW_COPY_AND_ASSIGN(SessionRestoreUITest); }; -#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS) -// This test is flaky on linux/views builds. -// See http://crbug.com/28808. -#define NormalAndPopup FLAKY_NormalAndPopup -#endif - - TEST_F(SessionRestoreUITest, Basic) { NavigateToURL(url1_); NavigateToURL(url2_); @@ -279,6 +272,22 @@ TEST_F(SessionRestoreUITest, NormalAndPopup) { ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); ASSERT_EQ(2, window_count); + scoped_refptr<BrowserProxy> popup(automation()->GetBrowserWindow(1)); + ASSERT_TRUE(popup.get()); + + scoped_refptr<TabProxy> tab(popup->GetTab(0)); + ASSERT_TRUE(tab.get()); + + tab->NavigateToURL(url1_); + + // Simulate an exit by shuting down the session service. If we don't do this + // the first window close is treated as though the user closed the window + // and won't be restored. + ASSERT_TRUE(popup->ShutdownSessionService()); + + tab = NULL; + popup = NULL; + // Restart and make sure we have only one window with one tab and the url // is url1_. QuitBrowserAndRestore(1); @@ -308,7 +317,6 @@ TEST_F(SessionRestoreUITest, NormalAndPopup) { } } - #if defined(OS_WIN) // Creates a browser, goes incognito, closes browser, launches and make sure // we don't restore. |