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
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 468e5e1..aa35bab9 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -462,6 +462,8 @@
                                     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::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) {