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

Unified Diff: content/browser/download/download_file_unittest.cc

Issue 18284005: Make ByteStream independent from DownloadInterruptReason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT all Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_file_unittest.cc
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc
index a3aafffbcc34c6e3ef32b0105d31a0b42a470489..61b2e36d8089b7a8e3dd4512a431cfc7f46a5850 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -33,13 +33,13 @@ using ::testing::StrictMock;
namespace content {
namespace {
-class MockByteStreamReader : public ByteStreamReader {
+class MockByteStreamReader : public ByteStreamReader<DownloadInterruptReason> {
public:
MockByteStreamReader() {}
~MockByteStreamReader() {}
// ByteStream functions
- MOCK_METHOD2(Read, ByteStreamReader::StreamState(
+ MOCK_METHOD2(Read, ByteStreamReader<DownloadInterruptReason>::StreamState(
scoped_refptr<net::IOBuffer>*, size_t*));
MOCK_CONST_METHOD0(GetStatus, DownloadInterruptReason());
MOCK_METHOD1(RegisterCallback, void(const base::Closure&));
@@ -129,18 +129,21 @@ class DownloadFileTest : public testing::Test {
scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo());
download_file_.reset(
- new DownloadFileImpl(save_info.Pass(),
- base::FilePath(),
- GURL(), // Source
- GURL(), // Referrer
- calculate_hash,
- scoped_ptr<ByteStreamReader>(input_stream_),
- net::BoundNetLog(),
- scoped_ptr<PowerSaveBlocker>().Pass(),
- observer_factory_.GetWeakPtr()));
+ new DownloadFileImpl(
+ save_info.Pass(),
+ base::FilePath(),
+ GURL(), // Source
+ GURL(), // Referrer
+ calculate_hash,
+ scoped_ptr<ByteStreamReader<DownloadInterruptReason> >(
+ input_stream_),
+ net::BoundNetLog(),
+ scoped_ptr<PowerSaveBlocker>().Pass(),
+ observer_factory_.GetWeakPtr()));
EXPECT_CALL(*input_stream_, Read(_, _))
- .WillOnce(Return(ByteStreamReader::STREAM_EMPTY))
+ .WillOnce(Return(
+ ByteStreamReader<DownloadInterruptReason>::STREAM_EMPTY))
.RetiresOnSaturation();
base::WeakPtrFactory<DownloadFileTest> weak_ptr_factory(this);
@@ -184,7 +187,9 @@ class DownloadFileTest : public testing::Test {
.InSequence(s)
.WillOnce(DoAll(SetArgPointee<0>(data),
SetArgPointee<1>(length),
- Return(ByteStreamReader::STREAM_HAS_DATA)))
+ Return(
+ ByteStreamReader<DownloadInterruptReason>::
+ STREAM_HAS_DATA)))
.RetiresOnSaturation();
expected_data_ += source_data;
}
@@ -203,7 +208,8 @@ class DownloadFileTest : public testing::Test {
SetupDataAppend(data_chunks, num_chunks, s1);
EXPECT_CALL(*input_stream_, Read(_, _))
.InSequence(s1)
- .WillOnce(Return(ByteStreamReader::STREAM_EMPTY))
+ .WillOnce(Return(
+ ByteStreamReader<DownloadInterruptReason>::STREAM_EMPTY))
.RetiresOnSaturation();
sink_callback_.Run();
VerifyStreamAndSize();
@@ -213,7 +219,8 @@ class DownloadFileTest : public testing::Test {
::testing::Sequence s) {
EXPECT_CALL(*input_stream_, Read(_, _))
.InSequence(s)
- .WillOnce(Return(ByteStreamReader::STREAM_COMPLETE))
+ .WillOnce(Return(
+ ByteStreamReader<DownloadInterruptReason>::STREAM_COMPLETE))
.RetiresOnSaturation();
EXPECT_CALL(*input_stream_, GetStatus())
.InSequence(s)

Powered by Google App Engine
This is Rietveld 408576698