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

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

Issue 10831302: Download resumption - Preliminary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed signed/unsigned compare issue. Created 8 years 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 (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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 virtual ~DownloadItemModelTest() { 60 virtual ~DownloadItemModelTest() {
61 } 61 }
62 62
63 protected: 63 protected:
64 // Sets up defaults for the download item and sets |model_| to a new 64 // Sets up defaults for the download item and sets |model_| to a new
65 // DownloadItemModel that uses the mock download item. 65 // DownloadItemModel that uses the mock download item.
66 void SetupDownloadItemDefaults() { 66 void SetupDownloadItemDefaults() {
67 ON_CALL(item_, GetReceivedBytes()).WillByDefault(Return(1)); 67 ON_CALL(item_, GetReceivedBytes()).WillByDefault(Return(1));
68 ON_CALL(item_, GetTotalBytes()).WillByDefault(Return(2)); 68 ON_CALL(item_, GetTotalBytes()).WillByDefault(Return(2));
69 ON_CALL(item_, IsInProgress()).WillByDefault(Return(true)); 69 ON_CALL(item_, IsInProgress()).WillByDefault(Return(true));
70 ON_CALL(item_, CanResumeInterrupted()).WillByDefault(Return(false));
70 ON_CALL(item_, TimeRemaining(_)).WillByDefault(Return(false)); 71 ON_CALL(item_, TimeRemaining(_)).WillByDefault(Return(false));
71 ON_CALL(item_, GetMimeType()).WillByDefault(Return("text/html")); 72 ON_CALL(item_, GetMimeType()).WillByDefault(Return("text/html"));
72 ON_CALL(item_, AllDataSaved()).WillByDefault(Return(false)); 73 ON_CALL(item_, AllDataSaved()).WillByDefault(Return(false));
73 ON_CALL(item_, GetOpenWhenComplete()).WillByDefault(Return(false)); 74 ON_CALL(item_, GetOpenWhenComplete()).WillByDefault(Return(false));
74 ON_CALL(item_, GetFileExternallyRemoved()).WillByDefault(Return(false)); 75 ON_CALL(item_, GetFileExternallyRemoved()).WillByDefault(Return(false));
75 ON_CALL(item_, GetState()) 76 ON_CALL(item_, GetState())
76 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); 77 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS));
77 ON_CALL(item_, GetURL()) 78 ON_CALL(item_, GetURL())
78 .WillByDefault(ReturnRefOfCopy(GURL("http://example.com/foo.bar"))); 79 .WillByDefault(ReturnRefOfCopy(GURL("http://example.com/foo.bar")));
79 ON_CALL(item_, GetFileNameToReportUser()) 80 ON_CALL(item_, GetFileNameToReportUser())
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 Return(test_case.time_remaining_known))); 376 Return(test_case.time_remaining_known)));
376 EXPECT_CALL(item(), GetOpenWhenComplete()) 377 EXPECT_CALL(item(), GetOpenWhenComplete())
377 .WillRepeatedly(Return(test_case.open_when_complete)); 378 .WillRepeatedly(Return(test_case.open_when_complete));
378 EXPECT_CALL(item(), IsPaused()) 379 EXPECT_CALL(item(), IsPaused())
379 .WillRepeatedly(Return(test_case.is_paused)); 380 .WillRepeatedly(Return(test_case.is_paused));
380 381
381 EXPECT_STREQ(test_case.expected_status, 382 EXPECT_STREQ(test_case.expected_status,
382 UTF16ToUTF8(model().GetStatusText()).c_str()); 383 UTF16ToUTF8(model().GetStatusText()).c_str());
383 } 384 }
384 } 385 }
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