summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 14:30:27 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 14:30:27 +0000
commit4794938ba46c128bd207c4f4509f86b1aceb1284 (patch)
tree9bf746f8ca8a11708a4255c37d00f87e30fb9c83 /chrome/test/automation
parentdef969b7488c51105269ffd50e775ab4a46dd022 (diff)
downloadchromium_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/test/automation')
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc2
-rw-r--r--chrome/test/automation/tab_proxy.cc7
-rw-r--r--chrome/test/automation/tab_proxy.h4
3 files changed, 8 insertions, 5 deletions
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 74a2eef..c1bd5b8 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -800,7 +800,7 @@ TEST_F(AutomationProxyTest, AutocompleteParallelProxy)
scoped_ptr<AutocompleteEditProxy> edit2(
automation()->GetAutocompleteEditForBrowser(browser2.get()));
ASSERT_TRUE(edit2.get());
- EXPECT_TRUE(browser2->GetTab(0)->WaitForTabToBeRestored());
+ EXPECT_TRUE(browser2->GetTab(0)->WaitForTabToBeRestored(kWaitForActionMsec));
const std::wstring text_to_set1 = L"Lollerskates";
const std::wstring text_to_set2 = L"Roflcopter";
std::wstring actual_text1, actual_text2;
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 2cca9a4..c359f34 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -797,13 +797,14 @@ bool TabProxy::ProcessUnhandledAccelerator(const MSG& msg) {
// This message expects no response
}
-bool TabProxy::WaitForTabToBeRestored() {
+bool TabProxy::WaitForTabToBeRestored(uint32 timeout_ms) {
if (!is_valid())
return false;
IPC::Message* response = NULL;
- return sender_->SendAndWaitForResponse(
+ bool is_timeout;
+ return sender_->SendAndWaitForResponseWithTimeout(
new AutomationMsg_WaitForTabToBeRestored(0, handle_), &response,
- AutomationMsg_TabFinishedRestoring::ID);
+ AutomationMsg_TabFinishedRestoring::ID, timeout_ms, &is_timeout);
}
bool TabProxy::GetSecurityState(SecurityStyle* security_style,
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index baa5a0f..6c2e660 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -237,7 +237,9 @@ class TabProxy : public AutomationResourceProxy {
// to handle the keys
bool ProcessUnhandledAccelerator(const MSG& msg);
- bool WaitForTabToBeRestored();
+ // Waits for the tab to finish being restored. Returns true on success.
+ // timeout_ms gives the max amount of time to wait for restore to complete.
+ bool WaitForTabToBeRestored(uint32 timeout_ms);
// Retrieves the different security states for the current tab.
bool GetSecurityState(SecurityStyle* security_style,