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

Side by Side Diff: chrome/browser/download/download_ui_controller_unittest.cc

Issue 2720613002: Downloads: Added transient flag to download item and download database (Closed)
Patch Set: fix tests Created 3 years, 9 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
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 "chrome/browser/download/download_ui_controller.h" 5 #include "chrome/browser/download/download_ui_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 EXPECT_CALL(*item, GetLastReason()) 234 EXPECT_CALL(*item, GetLastReason())
235 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); 235 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE));
236 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0)); 236 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0));
237 EXPECT_CALL(*item, GetReceivedSlices()).WillRepeatedly( 237 EXPECT_CALL(*item, GetReceivedSlices()).WillRepeatedly(
238 ReturnRefOfCopy(std::vector<content::DownloadItem::ReceivedSlice>())); 238 ReturnRefOfCopy(std::vector<content::DownloadItem::ReceivedSlice>()));
239 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0)); 239 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0));
240 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( 240 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly(
241 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); 241 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE));
242 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); 242 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false));
243 EXPECT_CALL(*item, GetLastAccessTime()).WillRepeatedly(Return(base::Time())); 243 EXPECT_CALL(*item, GetLastAccessTime()).WillRepeatedly(Return(base::Time()));
244 EXPECT_CALL(*item, IsVisible()).WillRepeatedly(Return(true));
244 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); 245 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string()));
245 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL())); 246 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL()));
246 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr)); 247 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr));
247 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); 248 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false));
248 return item; 249 return item;
249 } 250 }
250 251
251 std::unique_ptr<DownloadUIController::Delegate> 252 std::unique_ptr<DownloadUIController::Delegate>
252 DownloadUIControllerTest::GetTestDelegate() { 253 DownloadUIControllerTest::GetTestDelegate() {
253 std::unique_ptr<DownloadUIController::Delegate> delegate( 254 std::unique_ptr<DownloadUIController::Delegate> delegate(
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // DownloadUIController. It should ignore the download since it's marked as 356 // DownloadUIController. It should ignore the download since it's marked as
356 // being restored from history. 357 // being restored from history.
357 ASSERT_TRUE(manager_observer()); 358 ASSERT_TRUE(manager_observer());
358 manager_observer()->OnDownloadCreated(manager(), item.get()); 359 manager_observer()->OnDownloadCreated(manager(), item.get());
359 360
360 // Finally, the expectation we've been waiting for: 361 // Finally, the expectation we've been waiting for:
361 EXPECT_FALSE(notified_item()); 362 EXPECT_FALSE(notified_item());
362 } 363 }
363 364
364 } // namespace 365 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698