| 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 "base/test/scoped_async_task_scheduler.h" | 12 #include "base/test/scoped_async_task_scheduler.h" |
| 13 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" | 13 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| 14 #include "components/component_updater/component_updater_switches.h" | 14 #include "components/component_updater/component_updater_switches.h" |
| 15 #include "components/component_updater/component_updater_url_constants.h" | 15 #include "components/component_updater/component_updater_url_constants.h" |
| 16 #include "components/component_updater/configurator_impl.h" | 16 #include "components/component_updater/configurator_impl.h" |
| 17 #include "components/prefs/testing_pref_service.h" | 17 #include "components/prefs/testing_pref_service.h" |
| 18 #include "components/update_client/configurator.h" | 18 #include "components/update_client/configurator.h" |
| 19 #include "components/update_client/update_query_params.h" | 19 #include "components/update_client/update_query_params.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 22 | 22 |
| 23 namespace component_updater { | 23 namespace component_updater { |
| 24 | 24 |
| 25 class ChromeComponentUpdaterConfiguratorTest : public testing::Test { | 25 class ChromeComponentUpdaterConfiguratorTest : public testing::Test { |
| 26 public: | 26 public: |
| 27 ChromeComponentUpdaterConfiguratorTest() {} | 27 ChromeComponentUpdaterConfiguratorTest() {} |
| 28 ~ChromeComponentUpdaterConfiguratorTest() override{}; | 28 ~ChromeComponentUpdaterConfiguratorTest() override {} |
| 29 | 29 |
| 30 // Overrides from testing::Test. | 30 // Overrides from testing::Test. |
| 31 void SetUp() override; | 31 void SetUp() override; |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 TestingPrefServiceSimple* pref_service() { return pref_service_.get(); } | 34 TestingPrefServiceSimple* pref_service() { return pref_service_.get(); } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_; | 37 base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_; |
| 38 std::unique_ptr<TestingPrefServiceSimple> pref_service_; | 38 std::unique_ptr<TestingPrefServiceSimple> pref_service_; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestProdId) { | 178 TEST_F(ChromeComponentUpdaterConfiguratorTest, TestProdId) { |
| 179 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); | 179 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); |
| 180 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, | 180 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr, |
| 181 pref_service())); | 181 pref_service())); |
| 182 EXPECT_STREQ(update_client::UpdateQueryParams::GetProdIdString( | 182 EXPECT_STREQ(update_client::UpdateQueryParams::GetProdIdString( |
| 183 update_client::UpdateQueryParams::ProdId::CHROME), | 183 update_client::UpdateQueryParams::ProdId::CHROME), |
| 184 config->GetProdId().c_str()); | 184 config->GetProdId().c_str()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace component_updater | 187 } // namespace component_updater |
| OLD | NEW |