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

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

Issue 1226643002: Welcome page changes for Windows 10 and over. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rewording in policy_templates.json and sync to position 338549 Created 5 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/test/scoped_path_override.h" 8 #include "base/test/scoped_path_override.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/first_run/first_run.h" 10 #include "chrome/browser/first_run/first_run.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 EXPECT_EQ(2U, install_prefs.master_dictionary().size()); 53 EXPECT_EQ(2U, install_prefs.master_dictionary().size());
54 54
55 MasterPrefs out_prefs; 55 MasterPrefs out_prefs;
56 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs); 56 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
57 EXPECT_EQ("xyz", out_prefs.variations_seed); 57 EXPECT_EQ("xyz", out_prefs.variations_seed);
58 EXPECT_EQ("abc", out_prefs.variations_seed_signature); 58 EXPECT_EQ("abc", out_prefs.variations_seed_signature);
59 // Variations prefs should have been extracted (removed) from the dictionary. 59 // Variations prefs should have been extracted (removed) from the dictionary.
60 EXPECT_TRUE(install_prefs.master_dictionary().empty()); 60 EXPECT_TRUE(install_prefs.master_dictionary().empty());
61 } 61 }
62 62
63 TEST_F(FirstRunTest,
64 SetupMasterPrefsFromInstallPrefs_WelcomePageOnOSUpgradeMissing) {
65 installer::MasterPreferences install_prefs("{\"distribution\":{}}");
66 MasterPrefs out_prefs;
67 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
68 EXPECT_TRUE(out_prefs.welcome_page_on_os_upgrade_enabled);
69 }
70
71 TEST_F(FirstRunTest,
72 SetupMasterPrefsFromInstallPrefs_WelcomePageOnOSUpgradeEnabled) {
73 installer::MasterPreferences install_prefs(
74 "{\"distribution\":{\"welcome_page_on_os_upgrade_enabled\": true}}");
75 MasterPrefs out_prefs;
76 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
77 EXPECT_TRUE(out_prefs.welcome_page_on_os_upgrade_enabled);
78 }
79
80 TEST_F(FirstRunTest,
81 SetupMasterPrefsFromInstallPrefs_WelcomePageOnOSUpgradeDisabled) {
82 installer::MasterPreferences install_prefs(
83 "{\"distribution\":{\"welcome_page_on_os_upgrade_enabled\": false}}");
84 MasterPrefs out_prefs;
85 internal::SetupMasterPrefsFromInstallPrefs(install_prefs, &out_prefs);
86 EXPECT_FALSE(out_prefs.welcome_page_on_os_upgrade_enabled);
87 }
88
63 } // namespace first_run 89 } // namespace first_run
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698