| Index: content/browser/download/download_file_unittest.cc
|
| ===================================================================
|
| --- content/browser/download/download_file_unittest.cc (revision 108294)
|
| +++ content/browser/download/download_file_unittest.cc (working copy)
|
| @@ -8,6 +8,8 @@
|
| #include "content/browser/browser_thread.h"
|
| #include "content/browser/download/download_create_info.h"
|
| #include "content/browser/download/download_file.h"
|
| +#include "content/browser/download/download_id.h"
|
| +#include "content/browser/download/download_id_factory.h"
|
| #include "content/browser/download/download_manager.h"
|
| #include "content/browser/download/download_request_handle.h"
|
| #include "content/browser/download/download_status_updater.h"
|
| @@ -17,6 +19,8 @@
|
| #include "net/base/net_errors.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| +DownloadId::Domain kValidIdDomain = "valid DownloadId::Domain";
|
| +
|
| class DownloadFileTest : public testing::Test {
|
| public:
|
|
|
| @@ -33,6 +37,7 @@
|
| // calling Release() on |download_manager_| won't ever result in its
|
| // destructor being called and we get a leak.
|
| DownloadFileTest() :
|
| + id_factory_(new DownloadIdFactory(kValidIdDomain)),
|
| ui_thread_(BrowserThread::UI, &loop_),
|
| file_thread_(BrowserThread::FILE, &loop_) {
|
| }
|
| @@ -43,7 +48,9 @@
|
| virtual void SetUp() {
|
| download_manager_delegate_.reset(new MockDownloadManagerDelegate());
|
| download_manager_ = new MockDownloadManager(
|
| - download_manager_delegate_.get(), &download_status_updater_);
|
| + download_manager_delegate_.get(),
|
| + id_factory_,
|
| + &download_status_updater_);
|
| }
|
|
|
| virtual void TearDown() {
|
| @@ -58,7 +65,7 @@
|
|
|
| virtual void CreateDownloadFile(scoped_ptr<DownloadFile>* file, int offset) {
|
| DownloadCreateInfo info;
|
| - info.download_id = kDummyDownloadId + offset;
|
| + info.download_id = DownloadId(kValidIdDomain, kDummyDownloadId + offset);
|
| // info.request_handle default constructed to null.
|
| info.save_info.file_stream = file_stream_;
|
| file->reset(new DownloadFile(&info, download_manager_));
|
| @@ -103,6 +110,7 @@
|
|
|
| private:
|
| MessageLoop loop_;
|
| + scoped_refptr<DownloadIdFactory> id_factory_;
|
| // UI thread.
|
| BrowserThread ui_thread_;
|
| // File thread to satisfy debug checks in DownloadFile.
|
|
|