diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 17:22:43 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 17:22:43 +0000 |
commit | 28d9c672a6fcf2d93c487ffb9b855c4d7fe58d22 (patch) | |
tree | d054790c8671b83c6bf339836231af818e7fc367 /chrome/browser/browser_init.cc | |
parent | d3bd376a7f7ed527f387ab8dbff1b8c832a55354 (diff) | |
download | chromium_src-28d9c672a6fcf2d93c487ffb9b855c4d7fe58d22.zip chromium_src-28d9c672a6fcf2d93c487ffb9b855c4d7fe58d22.tar.gz chromium_src-28d9c672a6fcf2d93c487ffb9b855c4d7fe58d22.tar.bz2 |
Attempt at fixing flakeyness when running session restore ui tests in
purify. I believe the ui test isn't waiting for the session restore to
complete, so that when the ui test does various asserts the state of
the browser is wrong.
BUG=6495
TEST=covered by tests
Review URL: http://codereview.chromium.org/28051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.cc')
-rw-r--r-- | chrome/browser/browser_init.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 047103a..c690ad8 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -450,11 +450,18 @@ bool BrowserInit::ProcessCommandLine( // compatibility with the old testing code // If there are any loose parameters, we expect each one to generate a // new tab; if there are none then we get one homepage tab. + int expected_tab_count = 1; + if (command_line.HasSwitch(switches::kRestoreLastSession)) { + StringToInt(command_line.GetSwitchValue(switches::kRestoreLastSession), + &expected_tab_count); + } else { + expected_tab_count = + std::max(1, static_cast<int>(command_line.GetLooseValues().size())); + } CreateAutomationProvider<TestingAutomationProvider>( testing_channel_id, profile, - std::max(static_cast<int>(command_line.GetLooseValues().size()), - 1)); + static_cast<size_t>(expected_tab_count)); } #endif } |