Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1086)

Side by Side Diff: chrome/browser/first_run/first_run_browsertest.cc

Issue 9016036: Implement the new first run bubble, clean up old bubbles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/browser_process.h" 5 #include "chrome/browser/browser_process.h"
6 #include "chrome/browser/first_run/first_run.h" 6 #include "chrome/browser/first_run/first_run.h"
7 #include "chrome/browser/prefs/pref_service.h" 7 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/common/pref_names.h" 8 #include "chrome/common/pref_names.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 typedef InProcessBrowserTest FirstRunBrowserTest; 12 typedef InProcessBrowserTest FirstRunBrowserTest;
13 13
14 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowFirstRunBubblePref) { 14 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowFirstRunBubblePref) {
15 EXPECT_TRUE(g_browser_process->local_state()->FindPreference( 15 EXPECT_TRUE(g_browser_process->local_state()->FindPreference(
16 prefs::kShouldShowFirstRunBubble)); 16 prefs::kShouldShowFirstRunBubble));
17 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(true)); 17 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(true));
18 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( 18 ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
19 prefs::kShouldShowFirstRunBubble)); 19 prefs::kShouldShowFirstRunBubble));
20 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( 20 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
21 prefs::kShouldShowFirstRunBubble)); 21 prefs::kShouldShowFirstRunBubble));
22 // Test that toggling the value works in either direction after it's been set.
23 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(false));
24 EXPECT_FALSE(g_browser_process->local_state()->GetBoolean(
25 prefs::kShouldShowFirstRunBubble));
26 EXPECT_TRUE(first_run::SetShowFirstRunBubblePref(true));
27 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
28 prefs::kShouldShowFirstRunBubble));
22 } 29 }
23 30
24 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) { 31 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetShowWelcomePagePref) {
25 EXPECT_FALSE(g_browser_process->local_state()->FindPreference( 32 EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
26 prefs::kShouldShowWelcomePage)); 33 prefs::kShouldShowWelcomePage));
27 EXPECT_TRUE(first_run::SetShowWelcomePagePref()); 34 EXPECT_TRUE(first_run::SetShowWelcomePagePref());
28 ASSERT_TRUE(g_browser_process->local_state()->FindPreference( 35 ASSERT_TRUE(g_browser_process->local_state()->FindPreference(
29 prefs::kShouldShowWelcomePage)); 36 prefs::kShouldShowWelcomePage));
30 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean( 37 EXPECT_TRUE(g_browser_process->local_state()->GetBoolean(
31 prefs::kShouldShowWelcomePage)); 38 prefs::kShouldShowWelcomePage));
32 } 39 }
33
34 IN_PROC_BROWSER_TEST_F(FirstRunBrowserTest, SetOEMFirstRunBubblePref) {
35 EXPECT_FALSE(g_browser_process->local_state()->FindPreference(
36 prefs::kShouldUseOEMFirstRunBubble));
37 EXPECT_TRUE(first_run::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(first_run::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 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698