| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/component_updater/configurator_impl.h" | 9 #include "components/component_updater/configurator_impl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 DISALLOW_COPY_AND_ASSIGN(ComponentUpdaterConfiguratorImplTest); | 29 DISALLOW_COPY_AND_ASSIGN(ComponentUpdaterConfiguratorImplTest); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 TEST_F(ComponentUpdaterConfiguratorImplTest, FastUpdate) { | 32 TEST_F(ComponentUpdaterConfiguratorImplTest, FastUpdate) { |
| 33 // Test the default timing values when no command line argument is present. | 33 // Test the default timing values when no command line argument is present. |
| 34 base::CommandLine cmdline(base::CommandLine::NO_PROGRAM); | 34 base::CommandLine cmdline(base::CommandLine::NO_PROGRAM); |
| 35 std::unique_ptr<ConfiguratorImpl> config( | 35 std::unique_ptr<ConfiguratorImpl> config( |
| 36 new ConfiguratorImpl(&cmdline, nullptr, false)); | 36 new ConfiguratorImpl(&cmdline, nullptr, false)); |
| 37 CHECK_EQ(6 * kDelayOneMinute, config->InitialDelay()); | 37 CHECK_EQ(6 * kDelayOneMinute, config->InitialDelay()); |
| 38 CHECK_EQ(5 * kDelayOneHour, config->NextCheckDelay()); | 38 CHECK_EQ(5 * kDelayOneHour, config->NextCheckDelay()); |
| 39 CHECK_EQ(1, config->StepDelay()); | |
| 40 CHECK_EQ(30 * kDelayOneMinute, config->OnDemandDelay()); | 39 CHECK_EQ(30 * kDelayOneMinute, config->OnDemandDelay()); |
| 41 CHECK_EQ(15 * kDelayOneMinute, config->UpdateDelay()); | 40 CHECK_EQ(15 * kDelayOneMinute, config->UpdateDelay()); |
| 42 | 41 |
| 43 // Test the fast-update timings. | 42 // Test the fast-update timings. |
| 44 cmdline.AppendSwitchASCII("--component-updater", "fast-update"); | 43 cmdline.AppendSwitchASCII("--component-updater", "fast-update"); |
| 45 config.reset(new ConfiguratorImpl(&cmdline, nullptr, false)); | 44 config.reset(new ConfiguratorImpl(&cmdline, nullptr, false)); |
| 46 CHECK_EQ(10, config->InitialDelay()); | 45 CHECK_EQ(10, config->InitialDelay()); |
| 47 CHECK_EQ(5 * kDelayOneHour, config->NextCheckDelay()); | 46 CHECK_EQ(5 * kDelayOneHour, config->NextCheckDelay()); |
| 48 CHECK_EQ(1, config->StepDelay()); | |
| 49 CHECK_EQ(2, config->OnDemandDelay()); | 47 CHECK_EQ(2, config->OnDemandDelay()); |
| 50 CHECK_EQ(10, config->UpdateDelay()); | 48 CHECK_EQ(10, config->UpdateDelay()); |
| 51 } | 49 } |
| 52 | 50 |
| 53 } // namespace component_updater | 51 } // namespace component_updater |
| OLD | NEW |