| 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)
|
|
|