| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 VerifySourceStreamsStates(stream_data_1); | 982 VerifySourceStreamsStates(stream_data_1); |
| 983 VerifySourceStreamsStates(stream_data_2); | 983 VerifySourceStreamsStates(stream_data_2); |
| 984 | 984 |
| 985 EXPECT_EQ(stream_0_length + stream_1_length + stream_2_length, | 985 EXPECT_EQ(stream_0_length + stream_1_length + stream_2_length, |
| 986 TotalBytesReceived()); | 986 TotalBytesReceived()); |
| 987 | 987 |
| 988 download_file_->Cancel(); | 988 download_file_->Cancel(); |
| 989 DestroyDownloadFile(0, false); | 989 DestroyDownloadFile(0, false); |
| 990 } | 990 } |
| 991 | 991 |
| 992 // Activate and deplete one stream, later add the second stream. | 992 // Activate and deplete one stream, later add the second stream. |
| 993 TEST_F(DownloadFileTest, MutipleStreamsFirstStreamWriteAllData) { | 993 TEST_F(DownloadFileTest, MutipleStreamsFirstStreamWriteAllData) { |
| 994 int64_t stream_0_length = GetBuffersLength(kTestData8, 4); | 994 int64_t stream_0_length = GetBuffersLength(kTestData8, 4); |
| 995 | 995 |
| 996 ASSERT_TRUE(CreateDownloadFile(0, DownloadSaveInfo::kLengthFullContent, true, | 996 ASSERT_TRUE(CreateDownloadFile(0, DownloadSaveInfo::kLengthFullContent, true, |
| 997 DownloadItem::ReceivedSlices())); | 997 DownloadItem::ReceivedSlices())); |
| 998 | 998 |
| 999 PrepareStream(&input_stream_, 0, false, true, kTestData8, 4); | 999 PrepareStream(&input_stream_, 0, false, true, kTestData8, 4); |
| 1000 | 1000 |
| 1001 EXPECT_CALL(*(observer_.get()), MockDestinationCompleted(_, _)); | 1001 EXPECT_CALL(*(observer_.get()), MockDestinationCompleted(_, _)); |
| 1002 | 1002 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1016 SourceStreamTestData stream_data_0(0, stream_0_length, true); | 1016 SourceStreamTestData stream_data_0(0, stream_0_length, true); |
| 1017 SourceStreamTestData stream_data_1(stream_0_length - 1, 0, false); | 1017 SourceStreamTestData stream_data_1(stream_0_length - 1, 0, false); |
| 1018 VerifySourceStreamsStates(stream_data_0); | 1018 VerifySourceStreamsStates(stream_data_0); |
| 1019 VerifySourceStreamsStates(stream_data_1); | 1019 VerifySourceStreamsStates(stream_data_1); |
| 1020 EXPECT_EQ(stream_0_length, TotalBytesReceived()); | 1020 EXPECT_EQ(stream_0_length, TotalBytesReceived()); |
| 1021 | 1021 |
| 1022 DestroyDownloadFile(0); | 1022 DestroyDownloadFile(0); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 } // namespace content | 1025 } // namespace content |
| OLD | NEW |