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

Unified Diff: chrome/browser/download/download_request_manager_unittest.cc

Issue 353015: Last patch in removing MessageLoop* caching. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_request_manager_unittest.cc
===================================================================
--- chrome/browser/download/download_request_manager_unittest.cc (revision 30863)
+++ chrome/browser/download/download_request_manager_unittest.cc (working copy)
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/download/download_request_manager.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
@@ -12,13 +13,15 @@
: public RenderViewHostTestHarness,
public DownloadRequestManager::Callback {
public:
+ DownloadRequestManagerTest() : io_thread_(ChromeThread::IO, &message_loop_) {}
+
virtual void SetUp() {
RenderViewHostTestHarness::SetUp();
allow_download_ = true;
ask_allow_count_ = cancel_count_ = continue_count_ = 0;
- download_request_manager_ = new DownloadRequestManager(NULL, NULL);
+ download_request_manager_ = new DownloadRequestManager();
test_delegate_.reset(new DownloadRequestManagerTestDelegate(this));
DownloadRequestManager::SetTestingDelegate(test_delegate_.get());
}
@@ -39,6 +42,7 @@
void CanDownload() {
download_request_manager_->CanDownloadImpl(
controller().tab_contents(), this);
+ message_loop_.RunAllPending();
}
bool ShouldAllowDownload() {
@@ -75,6 +79,8 @@
// Number of times ShouldAllowDownload was invoked.
int ask_allow_count_;
+
+ ChromeThread io_thread_;
};
TEST_F(DownloadRequestManagerTest, Allow) {
« no previous file with comments | « chrome/browser/download/download_request_manager.cc ('k') | chrome/browser/extensions/user_script_listener_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698