Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: chrome/browser/component_updater/component_updater_service_unittest.cc

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/component_updater_service.cc ('k') | chrome/browser/extensions/app_notify_channel_setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698