Home | History | Annotate | Download | only in first_run
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/browser_process.h"
      6 #include "chrome/browser/first_run/first_run.h"
      7 #include "chrome/browser/prefs/pref_service.h"
      8 #include "chrome/common/pref_names.h"
      9 #include "chrome/test/in_process_browser_test.h"
     10 #include "testing/gtest/include/gtest/gtest.h"
     11 
     12 typedef InProcessBrowserTest FirstRunBrowserTest;
     13 
     14 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowFirstRunBubblePref) {
     15   EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
     16       prefs::kShouldShowFirstRunBubble));
     17   EXPECT_TRUE(FirstRun::SetShowFirstRunBubblePref(true));
     18   ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
     19       prefs::kShouldShowFirstRunBubble));
     20   EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
     21       prefs::kShouldShowFirstRunBubble));
     22 }
     23 
     24 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) {
     25   EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
     26       prefs::kShouldShowWelcomePage));
     27   EXPECT_TRUE(FirstRun::SetShowWelcomePagePref());
     28   ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
     29       prefs::kShouldShowWelcomePage));
     30   EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
     31       prefs::kShouldShowWelcomePage));
     32 }
     33 
     34 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetOEMFirstRunBubblePref) {
     35   EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
     36       prefs::kShouldUseOEMFirstRunBubble));
     37   EXPECT_TRUE(FirstRun::SetOEMFirstRunBubblePref());
     38   ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
     39       prefs::kShouldUseOEMFirstRunBubble));
     40   EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
     41       prefs::kShouldUseOEMFirstRunBubble));
     42 }
     43 
     44 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetMinimalFirstRunBubblePref) {
     45   EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
     46       prefs::kShouldUseMinimalFirstRunBubble));
     47   EXPECT_TRUE(FirstRun::SetMinimalFirstRunBubblePref());
     48   ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
     49       prefs::kShouldUseMinimalFirstRunBubble));
     50   EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
     51       prefs::kShouldUseMinimalFirstRunBubble));
     52 }
     53