| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" | 10 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 const std::vector<GURL> pingUrls = config->PingUrl(); | 26 const std::vector<GURL> pingUrls = config->PingUrl(); |
| 27 EXPECT_TRUE(pingUrls.empty()); | 27 EXPECT_TRUE(pingUrls.empty()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 TEST(ChromeComponentUpdaterConfiguratorTest, TestFastUpdate) { | 30 TEST(ChromeComponentUpdaterConfiguratorTest, TestFastUpdate) { |
| 31 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); | 31 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); |
| 32 cmdline.AppendSwitchASCII(switches::kComponentUpdater, "fast-update"); | 32 cmdline.AppendSwitchASCII(switches::kComponentUpdater, "fast-update"); |
| 33 | 33 |
| 34 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr)); | 34 const auto config(MakeChromeComponentUpdaterConfigurator(&cmdline, nullptr)); |
| 35 | 35 |
| 36 ASSERT_EQ(10, config->InitialDelay()); | 36 CHECK_EQ(10, config->InitialDelay()); |
| 37 CHECK_EQ(60, config->NextCheckDelay()); | 37 CHECK_EQ(6 * 60 * 60, config->NextCheckDelay()); |
| 38 CHECK_EQ(1, config->StepDelay()); | 38 CHECK_EQ(1, config->StepDelay()); |
| 39 CHECK_EQ(2, config->OnDemandDelay()); | 39 CHECK_EQ(2, config->OnDemandDelay()); |
| 40 CHECK_EQ(10, config->UpdateDelay()); | 40 CHECK_EQ(10, config->UpdateDelay()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 TEST(ChromeComponentUpdaterConfiguratorTest, TestOverrideUrl) { | 43 TEST(ChromeComponentUpdaterConfiguratorTest, TestOverrideUrl) { |
| 44 const char overrideUrl[] = "http://0.0.0.0/"; | 44 const char overrideUrl[] = "http://0.0.0.0/"; |
| 45 | 45 |
| 46 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); | 46 base::CommandLine cmdline(*base::CommandLine::ForCurrentProcess()); |
| 47 | 47 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const ConfiguratorImpl config(cmdline, nullptr, false); | 109 const ConfiguratorImpl config(cmdline, nullptr, false); |
| 110 const auto urls = config.UpdateUrl(); | 110 const auto urls = config.UpdateUrl(); |
| 111 ASSERT_EQ(2u, urls.size()); | 111 ASSERT_EQ(2u, urls.size()); |
| 112 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str()); | 112 ASSERT_STREQ(kUpdaterDefaultUrl, urls[0].spec().c_str()); |
| 113 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str()); | 113 ASSERT_STREQ(kUpdaterFallbackUrl, urls[1].spec().c_str()); |
| 114 ASSERT_EQ(config.UpdateUrl(), config.PingUrl()); | 114 ASSERT_EQ(config.UpdateUrl(), config.PingUrl()); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace component_updater | 118 } // namespace component_updater |
| OLD | NEW |