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 "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/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 chrome::NOTIFICATION_COMPONENT_UPDATE_READY | 163 chrome::NOTIFICATION_COMPONENT_UPDATE_READY |
164 }; | 164 }; |
165 | 165 |
166 for (int ix = 0; ix != arraysize(notifications); ++ix) { | 166 for (int ix = 0; ix != arraysize(notifications); ++ix) { |
167 notification_tracker_.ListenFor( | 167 notification_tracker_.ListenFor( |
168 notifications[ix], content::NotificationService::AllSources()); | 168 notifications[ix], content::NotificationService::AllSources()); |
169 } | 169 } |
170 net::URLFetcher::SetEnableInterceptionForTests(true); | 170 net::URLFetcher::SetEnableInterceptionForTests(true); |
171 } | 171 } |
172 | 172 |
173 ~ComponentUpdaterTest() { | 173 virtual ~ComponentUpdaterTest() { |
174 net::URLFetcher::SetEnableInterceptionForTests(false); | 174 net::URLFetcher::SetEnableInterceptionForTests(false); |
175 } | 175 } |
176 | 176 |
177 void TearDown() { | 177 virtual void TearDown() { |
178 xmlCleanupGlobals(); | 178 xmlCleanupGlobals(); |
179 } | 179 } |
180 | 180 |
181 ComponentUpdateService* component_updater() { | 181 ComponentUpdateService* component_updater() { |
182 return component_updater_.get(); | 182 return component_updater_.get(); |
183 } | 183 } |
184 | 184 |
185 // Makes the full path to a component updater test file. | 185 // Makes the full path to a component updater test file. |
186 const FilePath test_file(const char* file) { | 186 const FilePath test_file(const char* file) { |
187 return test_data_dir_.AppendASCII(file); | 187 return test_data_dir_.AppendASCII(file); |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 test_configurator()->SetLoopCount(1); | 486 test_configurator()->SetLoopCount(1); |
487 component_updater()->Start(); | 487 component_updater()->Start(); |
488 message_loop.Run(); | 488 message_loop.Run(); |
489 | 489 |
490 EXPECT_EQ(1, interceptor.GetHitCount()); | 490 EXPECT_EQ(1, interceptor.GetHitCount()); |
491 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); | 491 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); |
492 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); | 492 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); |
493 | 493 |
494 component_updater()->Stop(); | 494 component_updater()->Stop(); |
495 } | 495 } |
OLD | NEW |