OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestEnabledComponentUpdates) { | 151 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestEnabledComponentUpdates) { |
152 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); | 152 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); |
153 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, | 153 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, |
154 pref_service())); | 154 pref_service())); |
155 // Tests the default is set to |true| and the component updates are enabled. | 155 // Tests the default is set to |true| and the component updates are enabled. |
156 EXPECT_TRUE(config->EnabledComponentUpdates()); | 156 EXPECT_TRUE(config->EnabledComponentUpdates()); |
157 | 157 |
158 // Tests the component updates are disabled. | 158 // Tests the component updates are disabled. |
159 pref_service()->SetManagedPref("component_updates.component_updates_enabled", | 159 pref_service()->SetManagedPref("component_updates.component_updates_enabled", |
160 new base::FundamentalValue(false)); | 160 new base::Value(false)); |
161 EXPECT_FALSE(config->EnabledComponentUpdates()); | 161 EXPECT_FALSE(config->EnabledComponentUpdates()); |
162 | 162 |
163 // Tests the component updates are enabled. | 163 // Tests the component updates are enabled. |
164 pref_service()->SetManagedPref("component_updates.component_updates_enabled", | 164 pref_service()->SetManagedPref("component_updates.component_updates_enabled", |
165 new base::FundamentalValue(true)); | 165 new base::Value(true)); |
166 EXPECT_TRUE(config->EnabledComponentUpdates()); | 166 EXPECT_TRUE(config->EnabledComponentUpdates()); |
167 | 167 |
168 // Sanity check setting the preference back to |false| and then removing it. | 168 // Sanity check setting the preference back to |false| and then removing it. |
169 pref_service()->SetManagedPref("component_updates.component_updates_enabled", | 169 pref_service()->SetManagedPref("component_updates.component_updates_enabled", |
170 new base::FundamentalValue(false)); | 170 new base::Value(false)); |
171 EXPECT_FALSE(config->EnabledComponentUpdates()); | 171 EXPECT_FALSE(config->EnabledComponentUpdates()); |
172 pref_service()->RemoveManagedPref( | 172 pref_service()->RemoveManagedPref( |
173 "component_updates.component_updates_enabled"); | 173 "component_updates.component_updates_enabled"); |
174 EXPECT_TRUE(config->EnabledComponentUpdates()); | 174 EXPECT_TRUE(config->EnabledComponentUpdates()); |
175 } | 175 } |
176 | 176 |
177 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestProdId) { | 177 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestProdId) { |
178 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); | 178 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); |
179 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, | 179 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, |
180 pref_service())); | 180 pref_service())); |
181 EXPECT_STREQ(update_client::UpdateQueryParams::GetProdIdString( | 181 EXPECT_STREQ(update_client::UpdateQueryParams::GetProdIdString( |
182 update_client::UpdateQueryParams::ProdId::CHROME), | 182 update_client::UpdateQueryParams::ProdId::CHROME), |
183 config->GetProdId().c_str()); | 183 config->GetProdId().c_str()); |
184 } | 184 } |
185 | 185 |
186 } // namespace component_updater | 186 } // namespace component_updater |
OLD | NEW |