diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 02:57:22 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-16 02:57:22 +0000 |
commit | 7fb087e0800d0faaa31e4a029ad6813f251b4848 (patch) | |
tree | 2076a41c5df464dda2709950cde1c4b4786280ed /chrome/browser/tab_restore_uitest.cc | |
parent | f643bc141744031f1e3b304f753dd3837e6600eb (diff) | |
download | chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.zip chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.tar.gz chromium_src-7fb087e0800d0faaa31e4a029ad6813f251b4848.tar.bz2 |
Remove timeout constants from ui_tests. All tests will now
use accessors for various timeouts which can be set (via
command line parameters) to values appropriate to the test
environment, such as longer timeouts when running under purify.
Review URL: http://codereview.chromium.org/18109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_restore_uitest.cc')
-rw-r--r-- | chrome/browser/tab_restore_uitest.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc index ad32b9d..48aea5a 100644 --- a/chrome/browser/tab_restore_uitest.cc +++ b/chrome/browser/tab_restore_uitest.cc @@ -69,7 +69,7 @@ TEST_F(TabRestoreUITest, Basic) { int new_tab_count; ASSERT_TRUE(browser_proxy->WaitForTabCountToChange(initial_tab_count, &new_tab_count, - 5000)); + action_max_timeout_ms())); scoped_ptr<TabProxy> new_tab(browser_proxy->GetTab(new_tab_count - 1)); // Make sure we're at url. new_tab->NavigateToURL(url1_); @@ -106,13 +106,13 @@ TEST_F(TabRestoreUITest, RestoreToDifferentWindow) { // Create a new browser. ASSERT_TRUE(automation()->OpenNewBrowserWindow(SW_HIDE)); - ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, - kWaitForActionMaxMsec)); + ASSERT_TRUE(automation()->WaitForWindowCountToBecome( + 2, action_max_timeout_ms())); // Close the first browser. EXPECT_TRUE(tab_proxy->Close(true)); - ASSERT_TRUE(automation()->WaitForWindowCountToBecome(1, - kWaitForActionMaxMsec)); + ASSERT_TRUE(automation()->WaitForWindowCountToBecome( + 1, action_max_timeout_ms())); // Tab and browser are no longer valid. tab_proxy.reset(); @@ -147,7 +147,7 @@ TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { int new_tab_count; ASSERT_TRUE(browser_proxy->WaitForTabCountToChange(initial_tab_count, &new_tab_count, - 5000)); + action_max_timeout_ms())); scoped_ptr<TabProxy> tab(browser_proxy->GetTab(new_tab_count - 1)); // Navigate to another same-site URL. @@ -192,7 +192,7 @@ TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) { int new_tab_count; ASSERT_TRUE(browser_proxy->WaitForTabCountToChange(initial_tab_count, &new_tab_count, - 5000)); + action_max_timeout_ms())); scoped_ptr<TabProxy> tab(browser_proxy->GetTab(new_tab_count - 1)); // Navigate to more URLs, then a cross-site URL. @@ -230,8 +230,8 @@ TEST_F(TabRestoreUITest, RestoreWindow) { int window_count; ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); ASSERT_TRUE(automation()->OpenNewBrowserWindow(SW_HIDE)); - ASSERT_TRUE(automation()->WaitForWindowCountToBecome(++window_count, - kWaitForActionMaxMsec)); + ASSERT_TRUE(automation()->WaitForWindowCountToBecome( + ++window_count, action_max_timeout_ms())); // Create two more tabs, one with url1, the other url2. scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -239,12 +239,12 @@ TEST_F(TabRestoreUITest, RestoreWindow) { ASSERT_TRUE(browser_proxy->GetTabCount(&initial_tab_count)); browser_proxy->AppendTab(url1_); ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 1, - kWaitForActionMaxMsec)); + action_max_timeout_ms())); 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)); + action_max_timeout_ms())); new_tab.reset(browser_proxy->GetTab(initial_tab_count + 1)); new_tab->NavigateToURL(url2_); @@ -252,29 +252,29 @@ TEST_F(TabRestoreUITest, RestoreWindow) { ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_CLOSE_WINDOW)); browser_proxy.reset(); new_tab.reset(); - ASSERT_TRUE(automation()->WaitForWindowCountToBecome(window_count - 1, - kWaitForActionMaxMsec)); + ASSERT_TRUE(automation()->WaitForWindowCountToBecome( + window_count - 1, action_max_timeout_ms())); // Restore the window. browser_proxy.reset(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_RESTORE_TAB)); - ASSERT_TRUE(automation()->WaitForWindowCountToBecome(window_count, - kWaitForActionMaxMsec)); + ASSERT_TRUE(automation()->WaitForWindowCountToBecome( + window_count, action_max_timeout_ms())); browser_proxy.reset(automation()->GetBrowserWindow(1)); ASSERT_TRUE(browser_proxy->WaitForTabCountToBecome(initial_tab_count + 2, - kWaitForActionMaxMsec)); + action_max_timeout_ms())); scoped_ptr<TabProxy> restored_tab_proxy( browser_proxy->GetTab(initial_tab_count)); - ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); + ASSERT_TRUE(restored_tab_proxy->WaitForTabToBeRestored(action_timeout_ms())); 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->WaitForTabToBeRestored(action_timeout_ms())); ASSERT_TRUE(restored_tab_proxy->GetCurrentURL(&url)); ASSERT_TRUE(url == url2_); } |