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

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

Issue 2829853011: Polish the cleaning up url request code for parallel download. (Closed)
Patch Set: Work on feedbacks. Created 3 years, 8 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
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_job.h » ('j') | 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) 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
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
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
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698