| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" | 12 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| 13 #include "components/component_updater/component_updater_switches.h" | 13 #include "components/component_updater/component_updater_switches.h" |
| 14 #include "components/component_updater/component_updater_url_constants.h" | 14 #include "components/component_updater/component_updater_url_constants.h" |
| 15 #include "components/component_updater/configurator_impl.h" | 15 #include "components/component_updater/configurator_impl.h" |
| 16 #include "components/prefs/testing_pref_service.h" | 16 #include "components/prefs/testing_pref_service.h" |
| 17 #include "components/update_client/configurator.h" | 17 #include "components/update_client/configurator.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 std::unique_ptr<TestingPrefServiceSimple> pref(new TestingPrefServiceSimple()); | |
| 22 | |
| 23 namespace component_updater { | 21 namespace component_updater { |
| 24 | 22 |
| 25 class ChromeComponentUpdaterConfiguratorTest : public testing::Test { | 23 class ChromeComponentUpdaterConfiguratorTest : public testing::Test { |
| 26 public: | 24 public: |
| 27 ChromeComponentUpdaterConfiguratorTest() {} | 25 ChromeComponentUpdaterConfiguratorTest() {} |
| 28 ~ChromeComponentUpdaterConfiguratorTest() override{}; | 26 ~ChromeComponentUpdaterConfiguratorTest() override{}; |
| 29 | 27 |
| 30 // Overrides from testing::Test. | 28 // Overrides from testing::Test. |
| 31 void SetUp() override; | 29 void SetUp() override; |
| 32 | 30 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Sanity check setting the preference back to |false| and then removing it. | 167 // Sanity check setting the preference back to |false| and then removing it. |
| 170 pref_service()->SetManagedPref("component_updates.component_updates_enabled", | 168 pref_service()->SetManagedPref("component_updates.component_updates_enabled", |
| 171 new base::FundamentalValue(false)); | 169 new base::FundamentalValue(false)); |
| 172 EXPECT_FALSE(config->EnabledComponentUpdates()); | 170 EXPECT_FALSE(config->EnabledComponentUpdates()); |
| 173 pref_service()->RemoveManagedPref( | 171 pref_service()->RemoveManagedPref( |
| 174 "component_updates.component_updates_enabled"); | 172 "component_updates.component_updates_enabled"); |
| 175 EXPECT_TRUE(config->EnabledComponentUpdates()); | 173 EXPECT_TRUE(config->EnabledComponentUpdates()); |
| 176 } | 174 } |
| 177 | 175 |
| 178 } // namespace component_updater | 176 } // namespace component_updater |
| OLD | NEW |