From fedaa7dbb468ff581f0a7d30d2410da15363d359 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Tue, 26 Jan 2010 20:34:57 +0000 Subject: 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 --- chrome/browser/automation/automation_provider.cc | 12 ++++++++++++ chrome/browser/automation/automation_provider.h | 1 + 2 files changed, 13 insertions(+) (limited to 'chrome/browser/automation') 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, 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); -- cgit v1.1