Chromium Code Reviews| 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 "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 6 #include "chrome/browser/first_run/first_run.h" | 7 #include "chrome/browser/first_run/first_run.h" |
| 7 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | |
| 10 #include "chrome/common/chrome_switches.h" | |
| 8 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 14 |
| 12 typedef InProcessBrowserTest FirstRunBrowserTest; | 15 typedef InProcessBrowserTest FirstRunBrowserTest; |
| 13 | 16 |
| 14 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowFirstRunBubblePref) { | 17 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowFirstRunBubblePref) { |
| 15 EXPECT_TRUE(g_browser_process->local_state()->FindPreference( | 18 EXPECT_TRUE(g_browser_process->local_state()->FindPreference( |
| 16 prefs::kShouldShowFirstRunBubble)); | 19 prefs::kShouldShowFirstRunBubble)); |
| 17 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(true)); | 20 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(true)); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 30 | 33 |
| 31 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { | 34 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { |
| 32 EXPECT_FALSE(g_browser_process->local_state()->FindPreference( | 35 EXPECT_FALSE(g_browser_process->local_state()->FindPreference( |
| 33 prefs::kShouldShowWelcomePage)); | 36 prefs::kShouldShowWelcomePage)); |
| 34 EXPECT_TRUE(first_run::SetShowWelcomePagePref()); | 37 EXPECT_TRUE(first_run::SetShowWelcomePagePref()); |
| 35 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( | 38 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( |
| 36 prefs::kShouldShowWelcomePage)); | 39 prefs::kShouldShowWelcomePage)); |
| 37 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( | 40 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( |
| 38 prefs::kShouldShowWelcomePage)); | 41 prefs::kShouldShowWelcomePage)); |
| 39 } | 42 } |
| 43 | |
| 44 namespace { | |
| 45 class FirstRunIntegrationBrowserTest : public InProcessBrowserTest { | |
| 46 public: | |
| 47 FirstRunIntegrationBrowserTest() {} | |
| 48 protected: | |
| 49 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
| 50 InProcessBrowserTest::SetUpCommandLine(command_line); | |
| 51 command_line->AppendSwitch(switches::kFirstRun); | |
| 52 command_line->AppendSwitch(switches::kFirstRunForceImport); | |
| 53 EXPECT_FALSE(ProfileManager::DidPerformProfileImport()); | |
| 54 } | |
| 55 }; | |
|
sky
2012/12/17 17:19:53
private: DISALLOW_..
tapted
2012/12/18 02:25:58
Done.
| |
| 56 } | |
| 57 | |
| 58 IN_PROC_BROWSER_TEST_F(FirstRunIntegrationBrowserTest, WaitForImport) { | |
| 59 ASSERT_TRUE(ProfileManager::DidPerformProfileImport()); | |
| 60 } | |
| OLD | NEW |