summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_init.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 16:01:45 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 16:01:45 +0000
commitbed519ec1404576d54703418c8f78596a77ebaca (patch)
tree0cc711864462f46f82eaf7e24381a3ebcaa9aca6 /chrome/browser/browser_init.cc
parent6f180a803b3352ca18739c9df81c2baf12e65449 (diff)
downloadchromium_src-bed519ec1404576d54703418c8f78596a77ebaca.zip
chromium_src-bed519ec1404576d54703418c8f78596a77ebaca.tar.gz
chromium_src-bed519ec1404576d54703418c8f78596a77ebaca.tar.bz2
Disables session restore on chrome os when running tests. This causes
problems with some tests as the nested message loop run by session restore gets prematurely exited and Chrome is left in a weird state. BUG=none TEST=none Review URL: http://codereview.chromium.org/294009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.cc')
-rw-r--r--chrome/browser/browser_init.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index eba5517..eb7c8765 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -507,6 +507,16 @@ bool BrowserInit::LaunchWithProfile::OpenStartupURLs(
bool is_process_startup,
const std::vector<GURL>& urls_to_open) {
SessionStartupPref pref = GetSessionStartupPref(command_line_, profile_);
+ if (is_process_startup &&
+ command_line_.HasSwitch(switches::kTestingChannelID) &&
+ !command_line_.HasSwitch(switches::kRestoreLastSession) &&
+ browser_defaults::kDefaultSessionStartupType !=
+ SessionStartupPref::DEFAULT) {
+ // When we have non DEFAULT session start type, then we won't open up a
+ // fresh session. But none of the tests are written with this in mind, so
+ // we explicitly ignore it during testing.
+ return false;
+ }
switch (pref.type) {
case SessionStartupPref::LAST:
if (!is_process_startup)