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

Side by Side Diff: content/browser/download/download_item_impl_unittest.cc

Issue 10805020: Kill DownloadItem::IsOtr() (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/stl_util.h" 6 #include "base/stl_util.h"
7 #include "base/threading/thread.h" 7 #include "base/threading/thread.h"
8 #include "content/browser/download/byte_stream.h" 8 #include "content/browser/download/byte_stream.h"
9 #include "content/browser/download/download_create_info.h" 9 #include "content/browser/download/download_create_info.h"
10 #include "content/browser/download/download_file_manager.h" 10 #include "content/browser/download/download_file_manager.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 info_->download_id = 176 info_->download_id =
177 content::DownloadId(kValidDownloadItemIdDomain, ++next_id); 177 content::DownloadId(kValidDownloadItemIdDomain, ++next_id);
178 info_->prompt_user_for_save_location = false; 178 info_->prompt_user_for_save_location = false;
179 info_->url_chain.push_back(GURL()); 179 info_->url_chain.push_back(GURL());
180 info_->state = state; 180 info_->state = state;
181 181
182 scoped_ptr<DownloadRequestHandleInterface> request_handle( 182 scoped_ptr<DownloadRequestHandleInterface> request_handle(
183 new testing::NiceMock<MockRequestHandle>); 183 new testing::NiceMock<MockRequestHandle>);
184 DownloadItemImpl* download = 184 DownloadItemImpl* download =
185 new DownloadItemImpl(&delegate_, *(info_.get()), 185 new DownloadItemImpl(&delegate_, *(info_.get()),
186 request_handle.Pass(), false, net::BoundNetLog()); 186 request_handle.Pass(), net::BoundNetLog());
187 allocated_downloads_.insert(download); 187 allocated_downloads_.insert(download);
188 return download; 188 return download;
189 } 189 }
190 190
191 // Destroy a previously created download item. 191 // Destroy a previously created download item.
192 void DestroyDownloadItem(DownloadItem* item) { 192 void DestroyDownloadItem(DownloadItem* item) {
193 allocated_downloads_.erase(item); 193 allocated_downloads_.erase(item);
194 delete item; 194 delete item;
195 } 195 }
196 196
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 DownloadItemImpl* item = CreateDownloadItem(DownloadItem::IN_PROGRESS); 583 DownloadItemImpl* item = CreateDownloadItem(DownloadItem::IN_PROGRESS);
584 584
585 EXPECT_FALSE(item->GetFileExternallyRemoved()); 585 EXPECT_FALSE(item->GetFileExternallyRemoved());
586 item->OnDownloadedFileRemoved(); 586 item->OnDownloadedFileRemoved();
587 EXPECT_TRUE(item->GetFileExternallyRemoved()); 587 EXPECT_TRUE(item->GetFileExternallyRemoved());
588 } 588 }
589 589
590 TEST(MockDownloadItem, Compiles) { 590 TEST(MockDownloadItem, Compiles) {
591 MockDownloadItem mock_item; 591 MockDownloadItem mock_item;
592 } 592 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698