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

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

Issue 11673003: UI changes associated with downloads resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged from DownloadsResumption; includes CanResumeDownload, which was nuked in the original CL. Created 7 years, 11 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 "chrome/browser/download/download_item_model.h" 5 #include "chrome/browser/download/download_item_model.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 virtual ~DownloadItemModelTest() { 59 virtual ~DownloadItemModelTest() {
60 } 60 }
61 61
62 protected: 62 protected:
63 // Sets up defaults for the download item and sets |model_| to a new 63 // Sets up defaults for the download item and sets |model_| to a new
64 // DownloadItemModel that uses the mock download item. 64 // DownloadItemModel that uses the mock download item.
65 void SetupDownloadItemDefaults() { 65 void SetupDownloadItemDefaults() {
66 ON_CALL(item_, GetReceivedBytes()).WillByDefault(Return(1)); 66 ON_CALL(item_, GetReceivedBytes()).WillByDefault(Return(1));
67 ON_CALL(item_, GetTotalBytes()).WillByDefault(Return(2)); 67 ON_CALL(item_, GetTotalBytes()).WillByDefault(Return(2));
68 ON_CALL(item_, IsInProgress()).WillByDefault(Return(true)); 68 ON_CALL(item_, IsInProgress()).WillByDefault(Return(true));
69 ON_CALL(item_, CanResumeInterrupted()).WillByDefault(Return(false));
69 ON_CALL(item_, TimeRemaining(_)).WillByDefault(Return(false)); 70 ON_CALL(item_, TimeRemaining(_)).WillByDefault(Return(false));
70 ON_CALL(item_, GetMimeType()).WillByDefault(Return("text/html")); 71 ON_CALL(item_, GetMimeType()).WillByDefault(Return("text/html"));
71 ON_CALL(item_, AllDataSaved()).WillByDefault(Return(false)); 72 ON_CALL(item_, AllDataSaved()).WillByDefault(Return(false));
72 ON_CALL(item_, GetOpenWhenComplete()).WillByDefault(Return(false)); 73 ON_CALL(item_, GetOpenWhenComplete()).WillByDefault(Return(false));
73 ON_CALL(item_, GetFileExternallyRemoved()).WillByDefault(Return(false)); 74 ON_CALL(item_, GetFileExternallyRemoved()).WillByDefault(Return(false));
74 ON_CALL(item_, GetState()) 75 ON_CALL(item_, GetState())
75 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); 76 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS));
76 ON_CALL(item_, GetURL()) 77 ON_CALL(item_, GetURL())
77 .WillByDefault(ReturnRefOfCopy(GURL(kDefaultURL))); 78 .WillByDefault(ReturnRefOfCopy(GURL(kDefaultURL)));
78 ON_CALL(item_, GetFileNameToReportUser()) 79 ON_CALL(item_, GetFileNameToReportUser())
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // By default the download item should be displayable on the shelf. 351 // By default the download item should be displayable on the shelf.
351 EXPECT_TRUE(model().ShouldShowInShelf()); 352 EXPECT_TRUE(model().ShouldShowInShelf());
352 353
353 // Once explicitly set, ShouldShowInShelf() should return the explicit value. 354 // Once explicitly set, ShouldShowInShelf() should return the explicit value.
354 model().SetShouldShowInShelf(false); 355 model().SetShouldShowInShelf(false);
355 EXPECT_FALSE(model().ShouldShowInShelf()); 356 EXPECT_FALSE(model().ShouldShowInShelf());
356 357
357 model().SetShouldShowInShelf(true); 358 model().SetShouldShowInShelf(true);
358 EXPECT_TRUE(model().ShouldShowInShelf()); 359 EXPECT_TRUE(model().ShouldShowInShelf());
359 } 360 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_shelf_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698