OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 chrome::NOTIFICATION_COMPONENT_UPDATER_STARTED, | 147 chrome::NOTIFICATION_COMPONENT_UPDATER_STARTED, |
148 chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, | 148 chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING, |
149 chrome::NOTIFICATION_COMPONENT_UPDATE_FOUND, | 149 chrome::NOTIFICATION_COMPONENT_UPDATE_FOUND, |
150 chrome::NOTIFICATION_COMPONENT_UPDATE_READY | 150 chrome::NOTIFICATION_COMPONENT_UPDATE_READY |
151 }; | 151 }; |
152 | 152 |
153 for (int ix = 0; ix != arraysize(notifications); ++ix) { | 153 for (int ix = 0; ix != arraysize(notifications); ++ix) { |
154 notification_tracker_.ListenFor( | 154 notification_tracker_.ListenFor( |
155 notifications[ix], content::NotificationService::AllSources()); | 155 notifications[ix], content::NotificationService::AllSources()); |
156 } | 156 } |
157 URLFetcher::enable_interception_for_tests(true); | 157 content::URLFetcher::SetEnableInterceptionForTests(true); |
158 } | 158 } |
159 | 159 |
160 ~ComponentUpdaterTest() { | 160 ~ComponentUpdaterTest() { |
161 URLFetcher::enable_interception_for_tests(false); | 161 content::URLFetcher::SetEnableInterceptionForTests(false); |
162 } | 162 } |
163 | 163 |
164 ComponentUpdateService* component_updater() { | 164 ComponentUpdateService* component_updater() { |
165 return component_updater_.get(); | 165 return component_updater_.get(); |
166 } | 166 } |
167 | 167 |
168 // Makes the full path to a component updater test file. | 168 // Makes the full path to a component updater test file. |
169 const FilePath test_file(const char* file) { | 169 const FilePath test_file(const char* file) { |
170 return test_data_dir_.AppendASCII(file); | 170 return test_data_dir_.AppendASCII(file); |
171 } | 171 } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 test_configurator()->SetLoopCount(1); | 402 test_configurator()->SetLoopCount(1); |
403 component_updater()->Start(); | 403 component_updater()->Start(); |
404 message_loop.Run(); | 404 message_loop.Run(); |
405 | 405 |
406 EXPECT_EQ(1, interceptor->hit_count()); | 406 EXPECT_EQ(1, interceptor->hit_count()); |
407 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); | 407 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); |
408 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); | 408 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); |
409 | 409 |
410 component_updater()->Stop(); | 410 component_updater()->Stop(); |
411 } | 411 } |
OLD | NEW |