OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |