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) { |