diff options
author | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 01:16:25 +0000 |
---|---|---|
committer | tapted@chromium.org <tapted@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-21 01:16:25 +0000 |
commit | ae4c37e92410ecac0983171b35a3fd5a331075b5 (patch) | |
tree | a40f6c3f9af759dc509fcd7cd549851201e341f7 /chrome/browser/first_run/first_run_browsertest.cc | |
parent | 38afc5413a07c3101bd1d85aba1adbef08e360b1 (diff) | |
download | chromium_src-ae4c37e92410ecac0983171b35a3fd5a331075b5.zip chromium_src-ae4c37e92410ecac0983171b35a3fd5a331075b5.tar.gz chromium_src-ae4c37e92410ecac0983171b35a3fd5a331075b5.tar.bz2 |
Do not load extension system in the Profile import process.
Also, defer loading component extensions with background pages until
the import process is complete, so that the renderer host does not
compete for the database lock.
This also adds a regression test for http://crbug.com/163925.
BUG=163925,107636
TEST=Test first-run flows and profile import after uninstalling chrome and removing AppData/Local/Google/Chrome directory
Review URL: https://chromiumcodereview.appspot.com/11572036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run/first_run_browsertest.cc')
-rw-r--r-- | chrome/browser/first_run/first_run_browsertest.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/browser/first_run/first_run_browsertest.cc b/chrome/browser/first_run/first_run_browsertest.cc index 40383b2..50bd807 100644 --- a/chrome/browser/first_run/first_run_browsertest.cc +++ b/chrome/browser/first_run/first_run_browsertest.cc @@ -2,11 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/command_line.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" +#include "content/public/test/test_launcher.h" #include "testing/gtest/include/gtest/gtest.h" typedef InProcessBrowserTest FirstRunBrowserTest; @@ -37,3 +42,30 @@ IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( prefs::kShouldShowWelcomePage)); } + +namespace { +class FirstRunIntegrationBrowserTest : public InProcessBrowserTest { + public: + FirstRunIntegrationBrowserTest() {} + protected: + virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + InProcessBrowserTest::SetUpCommandLine(command_line); + command_line->AppendSwitch(switches::kFirstRun); + command_line->AppendSwitch(switches::kFirstRunForceImport); + EXPECT_FALSE(ProfileManager::DidPerformProfileImport()); + + extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); + + // The forked import process should run BrowserMain. + CommandLine import_arguments((CommandLine::NoProgram())); + import_arguments.AppendSwitch(content::kLaunchAsBrowser); + first_run::SetExtraArgumentsForImportProcess(import_arguments); + } + private: + DISALLOW_COPY_AND_ASSIGN(FirstRunIntegrationBrowserTest); +}; +} + +IN_PROC_BROWSER_TEST_F(FirstRunIntegrationBrowserTest, WaitForImport) { + ASSERT_TRUE(ProfileManager::DidPerformProfileImport()); +} |