| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/extensions/component_loader.h" | 7 #include "chrome/browser/extensions/component_loader.h" |
| 8 #include "chrome/browser/first_run/first_run.h" | 8 #include "chrome/browser/first_run/first_run.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { | 52 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { |
| 53 EXPECT_FALSE(g_browser_process->local_state()->FindPreference( | 53 EXPECT_FALSE(g_browser_process->local_state()->FindPreference( |
| 54 prefs::kShouldShowWelcomePage)); | 54 prefs::kShouldShowWelcomePage)); |
| 55 EXPECT_TRUE(first_run::SetShowWelcomePagePref()); | 55 EXPECT_TRUE(first_run::SetShowWelcomePagePref()); |
| 56 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( | 56 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( |
| 57 prefs::kShouldShowWelcomePage)); | 57 prefs::kShouldShowWelcomePage)); |
| 58 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( | 58 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( |
| 59 prefs::kShouldShowWelcomePage)); | 59 prefs::kShouldShowWelcomePage)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 #if !defined(OS_CHROMEOS) |
| 62 namespace { | 63 namespace { |
| 63 class FirstRunIntegrationBrowserTest : public InProcessBrowserTest { | 64 class FirstRunIntegrationBrowserTest : public InProcessBrowserTest { |
| 64 public: | 65 public: |
| 65 FirstRunIntegrationBrowserTest() {} | 66 FirstRunIntegrationBrowserTest() {} |
| 66 protected: | 67 protected: |
| 67 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 68 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 68 InProcessBrowserTest::SetUpCommandLine(command_line); | 69 InProcessBrowserTest::SetUpCommandLine(command_line); |
| 69 command_line->AppendSwitch(switches::kFirstRun); | 70 command_line->AppendSwitch(switches::kForceFirstRun); |
| 70 command_line->AppendSwitch(switches::kFirstRunForceImport); | |
| 71 EXPECT_FALSE(ProfileManager::DidPerformProfileImport()); | 71 EXPECT_FALSE(ProfileManager::DidPerformProfileImport()); |
| 72 | 72 |
| 73 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | 73 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); |
| 74 | 74 |
| 75 // The forked import process should run BrowserMain. | 75 // The forked import process should run BrowserMain. |
| 76 CommandLine import_arguments((CommandLine::NoProgram())); | 76 CommandLine import_arguments((CommandLine::NoProgram())); |
| 77 import_arguments.AppendSwitch(content::kLaunchAsBrowser); | 77 import_arguments.AppendSwitch(content::kLaunchAsBrowser); |
| 78 first_run::SetExtraArgumentsForImportProcess(import_arguments); | 78 first_run::SetExtraArgumentsForImportProcess(import_arguments); |
| 79 } | 79 } |
| 80 private: | 80 private: |
| 81 DISALLOW_COPY_AND_ASSIGN(FirstRunIntegrationBrowserTest); | 81 DISALLOW_COPY_AND_ASSIGN(FirstRunIntegrationBrowserTest); |
| 82 }; | 82 }; |
| 83 } | 83 } |
| 84 | 84 |
| 85 IN_PROC_BROWSER_TEST_F(FirstRunIntegrationBrowserTest, WaitForImport) { | 85 IN_PROC_BROWSER_TEST_F(FirstRunIntegrationBrowserTest, WaitForImport) { |
| 86 ASSERT_TRUE(ProfileManager::DidPerformProfileImport()); | 86 ASSERT_TRUE(ProfileManager::DidPerformProfileImport()); |
| 87 } | 87 } |
| 88 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |