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

Side by Side Diff: chrome/browser/component_updater/test/crx_downloader_unittest.cc

Issue 385013002: Componentize component_updater: Replace content::BrowserThread usage with task runners (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extraneous includes Created 6 years, 5 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 void CrxDownloaderTest::SetUp() { 109 void CrxDownloaderTest::SetUp() {
110 num_download_complete_calls_ = 0; 110 num_download_complete_calls_ = 0;
111 download_complete_result_ = CrxDownloader::Result(); 111 download_complete_result_ = CrxDownloader::Result();
112 num_progress_calls_ = 0; 112 num_progress_calls_ = 0;
113 download_progress_result_ = CrxDownloader::Result(); 113 download_progress_result_ = CrxDownloader::Result();
114 crx_downloader_.reset(CrxDownloader::Create( 114 crx_downloader_.reset(CrxDownloader::Create(
115 false, // Do not use the background downloader in these tests. 115 false, // Do not use the background downloader in these tests.
116 context_.get(), 116 context_.get(),
117 blocking_task_runner_)); 117 blocking_task_runner_,
118 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
118 crx_downloader_->set_progress_callback(progress_callback_); 119 crx_downloader_->set_progress_callback(progress_callback_);
119 } 120 }
120 121
121 void CrxDownloaderTest::TearDown() { 122 void CrxDownloaderTest::TearDown() {
122 crx_downloader_.reset(); 123 crx_downloader_.reset();
123 } 124 }
124 125
125 void CrxDownloaderTest::Quit() { 126 void CrxDownloaderTest::Quit() {
126 if (!quit_closure_.is_null()) 127 if (!quit_closure_.is_null())
127 quit_closure_.Run(); 128 quit_closure_.Run();
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 374
374 EXPECT_EQ(0, interceptor.GetHitCount()); 375 EXPECT_EQ(0, interceptor.GetHitCount());
375 376
376 EXPECT_EQ(1, num_download_complete_calls_); 377 EXPECT_EQ(1, num_download_complete_calls_);
377 EXPECT_EQ(kExpectedContext, crx_context_); 378 EXPECT_EQ(kExpectedContext, crx_context_);
378 EXPECT_NE(0, download_complete_result_.error); 379 EXPECT_NE(0, download_complete_result_.error);
379 EXPECT_TRUE(download_complete_result_.response.empty()); 380 EXPECT_TRUE(download_complete_result_.response.empty());
380 } 381 }
381 382
382 } // namespace component_updater 383 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698