diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 14:30:27 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 14:30:27 +0000 |
commit | 4794938ba46c128bd207c4f4509f86b1aceb1284 (patch) | |
tree | 9bf746f8ca8a11708a4255c37d00f87e30fb9c83 /chrome/browser/session_restore_uitest.cc | |
parent | def969b7488c51105269ffd50e775ab4a46dd022 (diff) | |
download | chromium_src-4794938ba46c128bd207c4f4509f86b1aceb1284.zip chromium_src-4794938ba46c128bd207c4f4509f86b1aceb1284.tar.gz chromium_src-4794938ba46c128bd207c4f4509f86b1aceb1284.tar.bz2 |
Two changes to help track down why session restore test is failing:
1. Adds a timeout in waiting for a tab to be restored.
2. Adds a bunch of printfs that will hopefully let me figure out where
the test is failing.
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/session_restore_uitest.cc')
-rw-r--r-- | chrome/browser/session_restore_uitest.cc | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/chrome/browser/session_restore_uitest.cc b/chrome/browser/session_restore_uitest.cc index 903bf0d..665ebe1 100644 --- a/chrome/browser/session_restore_uitest.cc +++ b/chrome/browser/session_restore_uitest.cc @@ -100,7 +100,7 @@ class SessionRestoreUITest : public UITest { ASSERT_EQ(0, active_tab_index); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); ASSERT_TRUE(tab_proxy->GetCurrentURL(url)); } @@ -128,7 +128,7 @@ TEST_F(SessionRestoreUITest, Basic) { window_count == 1); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(0)); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); ASSERT_EQ(url2, GetActiveTabURL()); tab_proxy->GoBack(); @@ -151,7 +151,7 @@ TEST_F(SessionRestoreUITest, RestoresForwardAndBackwardNavs) { window_count == 1); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(0)); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); ASSERT_TRUE(GetActiveTabURL() == url2); ASSERT_TRUE(tab_proxy->GoForward()); @@ -188,7 +188,7 @@ TEST_F(SessionRestoreUITest, RestoresCrossSiteForwardAndBackwardNavs) { int tab_count; ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count) && tab_count == 1); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(0)); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); // Check that back and forward work as expected. GURL url; @@ -237,13 +237,13 @@ TEST_F(SessionRestoreUITest, TwoTabsSecondSelected) { ASSERT_EQ(1, active_tab_index); tab_proxy.reset(browser_proxy->GetActiveTab()); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); ASSERT_TRUE(GetActiveTabURL() == url2); ASSERT_TRUE(browser_proxy->ActivateTab(0)); tab_proxy.reset(browser_proxy->GetActiveTab()); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); ASSERT_TRUE(GetActiveTabURL() == url1); } @@ -316,7 +316,7 @@ TEST_F(SessionRestoreUITest, DISABLED_DontRestoreWhileIncognito) { ASSERT_TRUE(browser_proxy.get()); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(0)); ASSERT_TRUE(tab_proxy.get()); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); GURL url; ASSERT_TRUE(tab_proxy->GetCurrentURL(&url)); ASSERT_TRUE(url != url1); @@ -403,25 +403,34 @@ TEST_F(SessionRestoreUITest, ShareProcessesOnRestore) { } scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); + printf("check point\n"); ASSERT_TRUE(browser_proxy.get() != NULL); int tab_count; ASSERT_TRUE(browser_proxy->GetTabCount(&tab_count)); + printf("check point\n"); // Create two new tabs. int new_tab_count; ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_NEWTAB)); + printf("check point\n"); ASSERT_TRUE(browser_proxy->WaitForTabCountToChange(tab_count, &new_tab_count, kWaitForActionMsec)); + printf("check point\n"); scoped_ptr<TabProxy> last_tab(browser_proxy->GetTab(new_tab_count - 1)); ASSERT_TRUE(last_tab.get() != NULL); // Do a reload to ensure new tab page has loaded. + printf("check point\n"); ASSERT_TRUE(last_tab->Reload()); tab_count = new_tab_count; + printf("check point\n"); ASSERT_TRUE(browser_proxy->ApplyAccelerator(IDC_NEWTAB)); + printf("check point\n"); ASSERT_TRUE(browser_proxy->WaitForTabCountToChange(tab_count, &new_tab_count, kWaitForActionMsec)); + printf("check point\n"); last_tab.reset(browser_proxy->GetTab(new_tab_count - 1)); ASSERT_TRUE(last_tab.get() != NULL); + printf("check point\n"); // Do a reload to ensure new tab page has loaded. ASSERT_TRUE(last_tab->Reload()); int expected_process_count = GetBrowserProcessCount(); @@ -429,22 +438,34 @@ TEST_F(SessionRestoreUITest, ShareProcessesOnRestore) { // Restart. browser_proxy.reset(); last_tab.reset(); + printf("check point\n"); QuitBrowserAndRestore(); + printf("check point\n"); // Wait for each tab to finish being restored, then make sure the process // count matches. browser_proxy.reset(automation()->GetBrowserWindow(0)); + printf("check point\n"); ASSERT_TRUE(browser_proxy.get() != NULL); int restored_tab_count; + printf("check point\n"); ASSERT_TRUE(browser_proxy->GetTabCount(&restored_tab_count)); + printf("check point\n"); ASSERT_EQ(new_tab_count, restored_tab_count); + printf("check point\n"); scoped_ptr<TabProxy> tab_proxy(browser_proxy->GetTab(restored_tab_count - 2)); + printf("check point\n"); ASSERT_TRUE(tab_proxy.get() != NULL); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + printf("check point\n"); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); + printf("check point\n"); tab_proxy.reset(browser_proxy->GetTab(restored_tab_count - 1)); + printf("check point\n"); ASSERT_TRUE(tab_proxy.get() != NULL); - ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored()); + printf("check point\n"); + ASSERT_TRUE(tab_proxy->WaitForTabToBeRestored(kWaitForActionMsec)); + printf("check point\n"); ASSERT_EQ(expected_process_count, GetBrowserProcessCount()); } |