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

Side by Side Diff: content/browser/download/download_status_updater_unittest.cc

Issue 8381009: Const-ify DownloadStatusUpdaterDelegate methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
« no previous file with comments | « content/browser/download/download_status_updater_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/memory/weak_ptr.h" 6 #include "base/memory/weak_ptr.h"
7 #include "content/browser/download/download_status_updater.h" 7 #include "content/browser/download/download_status_updater.h"
8 #include "content/browser/download/download_status_updater_delegate.h" 8 #include "content/browser/download/download_status_updater_delegate.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 12 matching lines...) Expand all
23 updater_->AddDelegate(this); 23 updater_->AddDelegate(this);
24 } 24 }
25 25
26 ~MockDelegate() { 26 ~MockDelegate() {
27 EXPECT_TRUE(updater_); 27 EXPECT_TRUE(updater_);
28 if (updater_) 28 if (updater_)
29 updater_->RemoveDelegate(this); 29 updater_->RemoveDelegate(this);
30 } 30 }
31 31
32 // Overriden from DownloadStatusUpdaterDelegate: 32 // Overriden from DownloadStatusUpdaterDelegate:
33 virtual bool IsDownloadProgressKnown() { 33 virtual bool IsDownloadProgressKnown() const OVERRIDE {
34 return is_download_progress_known_; 34 return is_download_progress_known_;
35 } 35 }
36 36
37 virtual int64 GetInProgressDownloadCount() { 37 virtual int64 GetInProgressDownloadCount() const OVERRIDE {
38 return in_progress_download_count_; 38 return in_progress_download_count_;
39 } 39 }
40 40
41 virtual int64 GetReceivedDownloadBytes() { 41 virtual int64 GetReceivedDownloadBytes() const OVERRIDE {
42 return received_bytes_; 42 return received_bytes_;
43 } 43 }
44 44
45 virtual int64 GetTotalDownloadBytes() { 45 virtual int64 GetTotalDownloadBytes() const OVERRIDE {
46 return total_bytes_; 46 return total_bytes_;
47 } 47 }
48 48
49 void set_is_download_progress_known(bool progress_known) { 49 void set_is_download_progress_known(bool progress_known) {
50 is_download_progress_known_ = progress_known; 50 is_download_progress_known_ = progress_known;
51 } 51 }
52 52
53 void set_in_progress_download_count(int64 download_count) { 53 void set_in_progress_download_count(int64 download_count) {
54 in_progress_download_count_ = download_count; 54 in_progress_download_count_ = download_count;
55 } 55 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 delegate1.reset(); 163 delegate1.reset();
164 164
165 { 165 {
166 float progress = -1; 166 float progress = -1;
167 int download_count = -1; 167 int download_count = -1;
168 EXPECT_TRUE(updater_.GetProgress(&progress, &download_count)); 168 EXPECT_TRUE(updater_.GetProgress(&progress, &download_count));
169 EXPECT_FLOAT_EQ(static_cast<float>(1) / 3, progress); 169 EXPECT_FLOAT_EQ(static_cast<float>(1) / 3, progress);
170 EXPECT_EQ(2, download_count); 170 EXPECT_EQ(2, download_count);
171 } 171 }
172 } 172 }
OLDNEW
« no previous file with comments | « content/browser/download/download_status_updater_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698