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

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

Issue 2705283003: Added last_access_time to DownloadItem and History DB (Closed)
Patch Set: comments 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 .WillRepeatedly(ReturnRefOfCopy(std::string())); 231 .WillRepeatedly(ReturnRefOfCopy(std::string()));
232 EXPECT_CALL(*item, GetDangerType()) 232 EXPECT_CALL(*item, GetDangerType())
233 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); 233 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS));
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, GetTotalBytes()).WillRepeatedly(Return(0)); 237 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0));
238 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( 238 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly(
239 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); 239 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE));
240 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); 240 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false));
241 EXPECT_CALL(*item, GetLastAccessTime()).WillRepeatedly(Return(base::Time()));
241 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); 242 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string()));
242 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL())); 243 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL()));
243 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr)); 244 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr));
244 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); 245 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false));
245 return item; 246 return item;
246 } 247 }
247 248
248 std::unique_ptr<DownloadUIController::Delegate> 249 std::unique_ptr<DownloadUIController::Delegate>
249 DownloadUIControllerTest::GetTestDelegate() { 250 DownloadUIControllerTest::GetTestDelegate() {
250 std::unique_ptr<DownloadUIController::Delegate> delegate( 251 std::unique_ptr<DownloadUIController::Delegate> delegate(
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // DownloadUIController. It should ignore the download since it's marked as 353 // DownloadUIController. It should ignore the download since it's marked as
353 // being restored from history. 354 // being restored from history.
354 ASSERT_TRUE(manager_observer()); 355 ASSERT_TRUE(manager_observer());
355 manager_observer()->OnDownloadCreated(manager(), item.get()); 356 manager_observer()->OnDownloadCreated(manager(), item.get());
356 357
357 // Finally, the expectation we've been waiting for: 358 // Finally, the expectation we've been waiting for:
358 EXPECT_FALSE(notified_item()); 359 EXPECT_FALSE(notified_item());
359 } 360 }
360 361
361 } // namespace 362 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698