| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/component_updater/component_updater_service.h" | 5 #include "chrome/browser/component_updater/component_updater_service.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } // namespace | 178 } // namespace |
| 179 | 179 |
| 180 // Common fixture for all the component updater tests. | 180 // Common fixture for all the component updater tests. |
| 181 class ComponentUpdaterTest : public testing::Test { | 181 class ComponentUpdaterTest : public testing::Test { |
| 182 public: | 182 public: |
| 183 enum TestComponents { | 183 enum TestComponents { |
| 184 kTestComponent_abag, | 184 kTestComponent_abag, |
| 185 kTestComponent_jebg | 185 kTestComponent_jebg |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 ComponentUpdaterTest() : component_updater_(NULL), test_config_(NULL) { | 188 ComponentUpdaterTest() : test_config_(NULL) { |
| 189 // The component updater instance under test. | 189 // The component updater instance under test. |
| 190 test_config_ = new TestConfigurator; | 190 test_config_ = new TestConfigurator; |
| 191 component_updater_.reset(ComponentUpdateServiceFactory(test_config_)); | 191 component_updater_.reset(ComponentUpdateServiceFactory(test_config_)); |
| 192 test_config_->SetComponentUpdateService(component_updater_.get()); | 192 test_config_->SetComponentUpdateService(component_updater_.get()); |
| 193 // The test directory is chrome/test/data/components. | 193 // The test directory is chrome/test/data/components. |
| 194 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); | 194 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); |
| 195 test_data_dir_ = test_data_dir_.AppendASCII("components"); | 195 test_data_dir_ = test_data_dir_.AppendASCII("components"); |
| 196 | 196 |
| 197 // Subscribe to all component updater notifications. | 197 // Subscribe to all component updater notifications. |
| 198 const int notifications[] = { | 198 const int notifications[] = { |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 // The test harness's Register() function creates a new installer, | 756 // The test harness's Register() function creates a new installer, |
| 757 // so the counts go back to 0. | 757 // so the counts go back to 0. |
| 758 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->error()); | 758 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->error()); |
| 759 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->install_count()); | 759 EXPECT_EQ(0, static_cast<TestInstaller*>(com1.installer)->install_count()); |
| 760 EXPECT_EQ(0, static_cast<TestInstaller*>(com2.installer)->error()); | 760 EXPECT_EQ(0, static_cast<TestInstaller*>(com2.installer)->error()); |
| 761 EXPECT_EQ(0, static_cast<TestInstaller*>(com2.installer)->install_count()); | 761 EXPECT_EQ(0, static_cast<TestInstaller*>(com2.installer)->install_count()); |
| 762 | 762 |
| 763 component_updater()->Stop(); | 763 component_updater()->Stop(); |
| 764 } | 764 } |
| OLD | NEW |