summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 20:34:57 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 20:34:57 +0000
commitfedaa7dbb468ff581f0a7d30d2410da15363d359 (patch)
treedd7228cfa6b299c50565c40c65d8413537b1e872 /chrome/test
parent6cbd5041c46c5b6e9e528e18ad1a6f612c27db30 (diff)
downloadchromium_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/test')
-rw-r--r--chrome/test/automation/automation_messages_internal.h6
-rw-r--r--chrome/test/automation/browser_proxy.cc15
-rw-r--r--chrome/test/automation/browser_proxy.h4
3 files changed, 25 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index b90280b..2103646 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -1183,4 +1183,10 @@ IPC_BEGIN_MESSAGES(Automation)
int /* tab_handle */,
int /* request_id */)
+ // Shuts down the session service for the browser identified by
+ // |browser_handle|. On success |result| is set to true.
+ IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShutdownSessionService,
+ int /* browser_handle */,
+ bool /* result */)
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 7da15e2..7ecb9d9 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -477,3 +477,18 @@ bool BrowserProxy::IsFullscreenBubbleVisible(bool* is_visible) {
return sender_->Send(new AutomationMsg_IsFullscreenBubbleVisible(0, handle_,
is_visible));
}
+
+bool BrowserProxy::ShutdownSessionService() {
+ bool did_shutdown = false;
+ bool succeeded = sender_->Send(
+ new AutomationMsg_ShutdownSessionService(0, handle_, &did_shutdown));
+
+ if (!succeeded) {
+ DLOG(ERROR) <<
+ "ShutdownSessionService did not complete in a timely fashion";
+ return false;
+ }
+
+ return did_shutdown;
+}
+
diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h
index 88a1d58..76de8f0 100644
--- a/chrome/test/automation/browser_proxy.h
+++ b/chrome/test/automation/browser_proxy.h
@@ -211,6 +211,10 @@ class BrowserProxy : public AutomationResourceProxy {
// Sets |is_visible| to whether the browser's fullscreen bubble is visible.
bool IsFullscreenBubbleVisible(bool* is_visible);
+ // Shuts down the session service for the browser's profile. Returns true
+ // on success.
+ bool ShutdownSessionService();
+
protected:
virtual ~BrowserProxy() {}
private: