summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
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/browser/automation
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/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc12
-rw-r--r--chrome/browser/automation/automation_provider.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 468e5e1..aa35bab 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -462,6 +462,8 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
InstallExtension)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_LoadExpandedExtension,
LoadExpandedExtension)
+ IPC_MESSAGE_HANDLER(AutomationMsg_ShutdownSessionService,
+ ShutdownSessionService)
IPC_END_MESSAGE_MAP()
}
@@ -745,6 +747,16 @@ void AutomationProvider::ClickAppModalDialogButton(int button, bool* success) {
}
}
+void AutomationProvider::ShutdownSessionService(int handle, bool* result) {
+ if (browser_tracker_->ContainsHandle(handle)) {
+ Browser* browser = browser_tracker_->GetResource(handle);
+ browser->profile()->ShutdownSessionService();
+ *result = true;
+ } else {
+ *result = false;
+ }
+}
+
void AutomationProvider::GetBrowserWindow(int index, int* handle) {
*handle = 0;
if (index >= 0) {
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 5b5ac29..08df2e2 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -155,6 +155,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
void GetNormalBrowserWindowCount(int* window_count);
void GetShowingAppModalDialog(bool* showing_dialog, int* dialog_button);
void ClickAppModalDialogButton(int button, bool* success);
+ void ShutdownSessionService(int handle, bool* result);
// Be aware that the browser window returned might be of non TYPE_NORMAL
// or in incognito mode.
void GetBrowserWindow(int index, int* handle);