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 "content/browser/download/download_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 DownloadTargetCallback* callback) { | 294 DownloadTargetCallback* callback) { |
295 MockDownloadFile* mock_download_file = nullptr; | 295 MockDownloadFile* mock_download_file = nullptr; |
296 std::unique_ptr<DownloadFile> download_file; | 296 std::unique_ptr<DownloadFile> download_file; |
297 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) | 297 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) |
298 .WillOnce(SaveArg<1>(callback)); | 298 .WillOnce(SaveArg<1>(callback)); |
299 | 299 |
300 // Only create a DownloadFile if the request was successful. | 300 // Only create a DownloadFile if the request was successful. |
301 if (create_info_->result == DOWNLOAD_INTERRUPT_REASON_NONE) { | 301 if (create_info_->result == DOWNLOAD_INTERRUPT_REASON_NONE) { |
302 mock_download_file = new StrictMock<MockDownloadFile>; | 302 mock_download_file = new StrictMock<MockDownloadFile>; |
303 download_file.reset(mock_download_file); | 303 download_file.reset(mock_download_file); |
304 EXPECT_CALL(*mock_download_file, Initialize(_)) | 304 EXPECT_CALL(*mock_download_file, Initialize(_, _)) |
305 .WillOnce(ScheduleCallbackWithParam(DOWNLOAD_INTERRUPT_REASON_NONE)); | 305 .WillOnce(ScheduleCallbackWithParam(DOWNLOAD_INTERRUPT_REASON_NONE)); |
306 EXPECT_CALL(*mock_download_file, FullPath()) | 306 EXPECT_CALL(*mock_download_file, FullPath()) |
307 .WillRepeatedly(ReturnRefOfCopy(base::FilePath())); | 307 .WillRepeatedly(ReturnRefOfCopy(base::FilePath())); |
308 } | 308 } |
309 | 309 |
310 std::unique_ptr<MockRequestHandle> request_handle = | 310 std::unique_ptr<MockRequestHandle> request_handle = |
311 base::MakeUnique<NiceMock<MockRequestHandle>>(); | 311 base::MakeUnique<NiceMock<MockRequestHandle>>(); |
312 item->Start(std::move(download_file), std::move(request_handle), | 312 item->Start(std::move(download_file), std::move(request_handle), |
313 *create_info_); | 313 *create_info_); |
314 RunAllPendingInMessageLoops(); | 314 RunAllPendingInMessageLoops(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 } | 586 } |
587 | 587 |
588 TEST_F(DownloadItemTest, NotificationAfterTogglePause) { | 588 TEST_F(DownloadItemTest, NotificationAfterTogglePause) { |
589 DownloadItemImpl* item = CreateDownloadItem(); | 589 DownloadItemImpl* item = CreateDownloadItem(); |
590 TestDownloadItemObserver observer(item); | 590 TestDownloadItemObserver observer(item); |
591 MockDownloadFile* mock_download_file(new MockDownloadFile); | 591 MockDownloadFile* mock_download_file(new MockDownloadFile); |
592 std::unique_ptr<DownloadFile> download_file(mock_download_file); | 592 std::unique_ptr<DownloadFile> download_file(mock_download_file); |
593 std::unique_ptr<DownloadRequestHandleInterface> request_handle( | 593 std::unique_ptr<DownloadRequestHandleInterface> request_handle( |
594 new NiceMock<MockRequestHandle>); | 594 new NiceMock<MockRequestHandle>); |
595 | 595 |
596 EXPECT_CALL(*mock_download_file, Initialize(_)); | 596 EXPECT_CALL(*mock_download_file, Initialize(_, _)); |
597 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(_, _)); | 597 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(_, _)); |
598 item->Start(std::move(download_file), std::move(request_handle), | 598 item->Start(std::move(download_file), std::move(request_handle), |
599 *create_info()); | 599 *create_info()); |
600 | 600 |
601 item->Pause(); | 601 item->Pause(); |
602 ASSERT_TRUE(observer.CheckAndResetDownloadUpdated()); | 602 ASSERT_TRUE(observer.CheckAndResetDownloadUpdated()); |
603 | 603 |
604 ASSERT_TRUE(item->IsPaused()); | 604 ASSERT_TRUE(item->IsPaused()); |
605 | 605 |
606 item->Resume(); | 606 item->Resume(); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 EXPECT_EQ(kFirstLastModified, item->GetLastModifiedTime()); | 884 EXPECT_EQ(kFirstLastModified, item->GetLastModifiedTime()); |
885 EXPECT_EQ(kFirstURL, item->GetURL().spec()); | 885 EXPECT_EQ(kFirstURL, item->GetURL().spec()); |
886 EXPECT_EQ(kMimeType, item->GetMimeType()); | 886 EXPECT_EQ(kMimeType, item->GetMimeType()); |
887 EXPECT_EQ(DownloadItem::INTERRUPTED, item->GetState()); | 887 EXPECT_EQ(DownloadItem::INTERRUPTED, item->GetState()); |
888 EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, item->GetLastReason()); | 888 EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, item->GetLastReason()); |
889 EXPECT_EQ(kDummyIntermediatePath, item->GetFullPath().value()); | 889 EXPECT_EQ(kDummyIntermediatePath, item->GetFullPath().value()); |
890 EXPECT_EQ(1, item->GetReceivedBytes()); | 890 EXPECT_EQ(1, item->GetReceivedBytes()); |
891 } | 891 } |
892 | 892 |
893 // If the download resumption request succeeds, the origin state should be | 893 // If the download resumption request succeeds, the origin state should be |
894 // updated | 894 // updated. |
895 TEST_F(DownloadItemTest, SucceededResumptionUpdatesOriginState) { | 895 TEST_F(DownloadItemTest, SucceededResumptionUpdatesOriginState) { |
896 const char kContentDisposition[] = "attachment; filename=foo"; | 896 const char kContentDisposition[] = "attachment; filename=foo"; |
897 const char kFirstETag[] = "ABC"; | 897 const char kFirstETag[] = "ABC"; |
898 const char kFirstLastModified[] = "Yesterday"; | 898 const char kFirstLastModified[] = "Yesterday"; |
899 const char kFirstURL[] = "http://www.example.com/download"; | 899 const char kFirstURL[] = "http://www.example.com/download"; |
900 const char kMimeType[] = "text/css"; | 900 const char kMimeType[] = "text/css"; |
901 create_info()->content_disposition = kContentDisposition; | 901 create_info()->content_disposition = kContentDisposition; |
902 create_info()->etag = kFirstETag; | 902 create_info()->etag = kFirstETag; |
903 create_info()->last_modified = kFirstLastModified; | 903 create_info()->last_modified = kFirstLastModified; |
904 create_info()->url_chain.push_back(GURL(kFirstURL)); | 904 create_info()->url_chain.push_back(GURL(kFirstURL)); |
(...skipping 29 matching lines...) Expand all Loading... |
934 | 934 |
935 EXPECT_EQ(kSecondContentDisposition, item->GetContentDisposition()); | 935 EXPECT_EQ(kSecondContentDisposition, item->GetContentDisposition()); |
936 EXPECT_EQ(kSecondETag, item->GetETag()); | 936 EXPECT_EQ(kSecondETag, item->GetETag()); |
937 EXPECT_EQ(kSecondLastModified, item->GetLastModifiedTime()); | 937 EXPECT_EQ(kSecondLastModified, item->GetLastModifiedTime()); |
938 EXPECT_EQ(kSecondURL, item->GetURL().spec()); | 938 EXPECT_EQ(kSecondURL, item->GetURL().spec()); |
939 EXPECT_EQ(kSecondMimeType, item->GetMimeType()); | 939 EXPECT_EQ(kSecondMimeType, item->GetMimeType()); |
940 | 940 |
941 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); | 941 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); |
942 } | 942 } |
943 | 943 |
| 944 // Ensure when strong validators changed on resumption, the received |
| 945 // slices should be cleared. |
| 946 TEST_F(DownloadItemTest, ClearReceivedSliceIfEtagChanged) { |
| 947 const char kFirstETag[] = "ABC"; |
| 948 const char kSecondETag[] = "123"; |
| 949 const DownloadItem::ReceivedSlices kReceivedSlice = { |
| 950 DownloadItem::ReceivedSlice(0, 10)}; |
| 951 create_info()->etag = kFirstETag; |
| 952 |
| 953 DownloadItemImpl* item = CreateDownloadItem(); |
| 954 MockDownloadFile* download_file = |
| 955 DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); |
| 956 |
| 957 EXPECT_CALL(*mock_delegate(), MockResumeInterruptedDownload(_, _)); |
| 958 EXPECT_CALL(*download_file, Detach()); |
| 959 |
| 960 item->DestinationObserverAsWeakPtr()->DestinationUpdate(10, 100, |
| 961 kReceivedSlice); |
| 962 EXPECT_EQ(kReceivedSlice, item->GetReceivedSlices()); |
| 963 EXPECT_EQ(10, item->GetReceivedBytes()); |
| 964 |
| 965 item->DestinationObserverAsWeakPtr()->DestinationError( |
| 966 DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR, 0, |
| 967 std::unique_ptr<crypto::SecureHash>()); |
| 968 EXPECT_EQ(kReceivedSlice, item->GetReceivedSlices()); |
| 969 |
| 970 RunAllPendingInMessageLoops(); |
| 971 |
| 972 // Change the strong validator and resume the download, the received slices |
| 973 // should be cleared. |
| 974 create_info()->etag = kSecondETag; |
| 975 DownloadTargetCallback target_callback; |
| 976 download_file = CallDownloadItemStart(item, &target_callback); |
| 977 EXPECT_TRUE(item->GetReceivedSlices().empty()); |
| 978 EXPECT_EQ(0, item->GetReceivedBytes()); |
| 979 |
| 980 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); |
| 981 } |
| 982 |
944 // Test that resumption uses the final URL in a URL chain when resuming. | 983 // Test that resumption uses the final URL in a URL chain when resuming. |
945 TEST_F(DownloadItemTest, ResumeUsesFinalURL) { | 984 TEST_F(DownloadItemTest, ResumeUsesFinalURL) { |
946 create_info()->save_info->prompt_for_save_location = false; | 985 create_info()->save_info->prompt_for_save_location = false; |
947 create_info()->url_chain.clear(); | 986 create_info()->url_chain.clear(); |
948 create_info()->url_chain.push_back(GURL("http://example.com/a")); | 987 create_info()->url_chain.push_back(GURL("http://example.com/a")); |
949 create_info()->url_chain.push_back(GURL("http://example.com/b")); | 988 create_info()->url_chain.push_back(GURL("http://example.com/b")); |
950 create_info()->url_chain.push_back(GURL("http://example.com/c")); | 989 create_info()->url_chain.push_back(GURL("http://example.com/c")); |
951 | 990 |
952 DownloadItemImpl* item = CreateDownloadItem(); | 991 DownloadItemImpl* item = CreateDownloadItem(); |
953 TestDownloadItemObserver observer(item); | 992 TestDownloadItemObserver observer(item); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 EXPECT_EQ(FILE_PATH_LITERAL("new.name"), | 1039 EXPECT_EQ(FILE_PATH_LITERAL("new.name"), |
1001 item->GetFileNameToReportUser().value()); | 1040 item->GetFileNameToReportUser().value()); |
1002 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); | 1041 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); |
1003 } | 1042 } |
1004 | 1043 |
1005 // Test to make sure that Start method calls DF initialize properly. | 1044 // Test to make sure that Start method calls DF initialize properly. |
1006 TEST_F(DownloadItemTest, Start) { | 1045 TEST_F(DownloadItemTest, Start) { |
1007 MockDownloadFile* mock_download_file(new MockDownloadFile); | 1046 MockDownloadFile* mock_download_file(new MockDownloadFile); |
1008 std::unique_ptr<DownloadFile> download_file(mock_download_file); | 1047 std::unique_ptr<DownloadFile> download_file(mock_download_file); |
1009 DownloadItemImpl* item = CreateDownloadItem(); | 1048 DownloadItemImpl* item = CreateDownloadItem(); |
1010 EXPECT_CALL(*mock_download_file, Initialize(_)); | 1049 EXPECT_CALL(*mock_download_file, Initialize(_, _)); |
1011 std::unique_ptr<DownloadRequestHandleInterface> request_handle( | 1050 std::unique_ptr<DownloadRequestHandleInterface> request_handle( |
1012 new NiceMock<MockRequestHandle>); | 1051 new NiceMock<MockRequestHandle>); |
1013 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)); | 1052 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)); |
1014 item->Start(std::move(download_file), std::move(request_handle), | 1053 item->Start(std::move(download_file), std::move(request_handle), |
1015 *create_info()); | 1054 *create_info()); |
1016 RunAllPendingInMessageLoops(); | 1055 RunAllPendingInMessageLoops(); |
1017 | 1056 |
1018 CleanupItem(item, mock_download_file, DownloadItem::IN_PROGRESS); | 1057 CleanupItem(item, mock_download_file, DownloadItem::IN_PROGRESS); |
1019 } | 1058 } |
1020 | 1059 |
1021 // Download file and the request should be cancelled as a result of download | 1060 // Download file and the request should be cancelled as a result of download |
1022 // file initialization failing. | 1061 // file initialization failing. |
1023 TEST_F(DownloadItemTest, InitDownloadFileFails) { | 1062 TEST_F(DownloadItemTest, InitDownloadFileFails) { |
1024 DownloadItemImpl* item = CreateDownloadItem(); | 1063 DownloadItemImpl* item = CreateDownloadItem(); |
1025 std::unique_ptr<MockDownloadFile> file = base::MakeUnique<MockDownloadFile>(); | 1064 std::unique_ptr<MockDownloadFile> file = base::MakeUnique<MockDownloadFile>(); |
1026 std::unique_ptr<MockRequestHandle> request_handle = | 1065 std::unique_ptr<MockRequestHandle> request_handle = |
1027 base::MakeUnique<MockRequestHandle>(); | 1066 base::MakeUnique<MockRequestHandle>(); |
1028 | 1067 |
1029 EXPECT_CALL(*file, Cancel()); | 1068 EXPECT_CALL(*file, Cancel()); |
1030 EXPECT_CALL(*request_handle, CancelRequest()); | 1069 EXPECT_CALL(*request_handle, CancelRequest()); |
1031 EXPECT_CALL(*file, Initialize(_)) | 1070 EXPECT_CALL(*file, Initialize(_, _)) |
1032 .WillOnce(ScheduleCallbackWithParam( | 1071 .WillOnce(ScheduleCallbackWithParam( |
1033 DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED)); | 1072 DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED)); |
1034 | 1073 |
1035 base::RunLoop start_download_loop; | 1074 base::RunLoop start_download_loop; |
1036 DownloadTargetCallback download_target_callback; | 1075 DownloadTargetCallback download_target_callback; |
1037 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) | 1076 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) |
1038 .WillOnce(DoAll(SaveArg<1>(&download_target_callback), | 1077 .WillOnce(DoAll(SaveArg<1>(&download_target_callback), |
1039 ScheduleClosure(start_download_loop.QuitClosure()))); | 1078 ScheduleClosure(start_download_loop.QuitClosure()))); |
1040 | 1079 |
1041 item->Start(std::move(file), std::move(request_handle), *create_info()); | 1080 item->Start(std::move(file), std::move(request_handle), *create_info()); |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2043 // Run through the DII workflow but the embedder cancels the download at target | 2082 // Run through the DII workflow but the embedder cancels the download at target |
2044 // determination. | 2083 // determination. |
2045 TEST_P(DownloadItemDestinationUpdateRaceTest, DownloadCancelledByUser) { | 2084 TEST_P(DownloadItemDestinationUpdateRaceTest, DownloadCancelledByUser) { |
2046 // Expect that the download file and the request will be cancelled as a | 2085 // Expect that the download file and the request will be cancelled as a |
2047 // result. | 2086 // result. |
2048 EXPECT_CALL(*file_, Cancel()); | 2087 EXPECT_CALL(*file_, Cancel()); |
2049 EXPECT_CALL(*request_handle_, CancelRequest()); | 2088 EXPECT_CALL(*request_handle_, CancelRequest()); |
2050 | 2089 |
2051 base::RunLoop download_start_loop; | 2090 base::RunLoop download_start_loop; |
2052 DownloadFile::InitializeCallback initialize_callback; | 2091 DownloadFile::InitializeCallback initialize_callback; |
2053 EXPECT_CALL(*file_, Initialize(_)) | 2092 EXPECT_CALL(*file_, Initialize(_, _)) |
2054 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), | 2093 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), |
2055 ScheduleClosure(download_start_loop.QuitClosure()))); | 2094 ScheduleClosure(download_start_loop.QuitClosure()))); |
2056 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); | 2095 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); |
2057 download_start_loop.Run(); | 2096 download_start_loop.Run(); |
2058 | 2097 |
2059 base::WeakPtr<DownloadDestinationObserver> destination_observer = | 2098 base::WeakPtr<DownloadDestinationObserver> destination_observer = |
2060 item_->DestinationObserverAsWeakPtr(); | 2099 item_->DestinationObserverAsWeakPtr(); |
2061 | 2100 |
2062 ScheduleObservations(PreInitializeFileObservations(), destination_observer); | 2101 ScheduleObservations(PreInitializeFileObservations(), destination_observer); |
2063 RunAllPendingInMessageLoops(); | 2102 RunAllPendingInMessageLoops(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 // DownloadFile expectations since we are about to transfer its ownership to | 2135 // DownloadFile expectations since we are about to transfer its ownership to |
2097 // the DownloadItem. | 2136 // the DownloadItem. |
2098 base::RunLoop intermediate_rename_loop; | 2137 base::RunLoop intermediate_rename_loop; |
2099 DownloadFile::RenameCompletionCallback intermediate_rename_callback; | 2138 DownloadFile::RenameCompletionCallback intermediate_rename_callback; |
2100 EXPECT_CALL(*file_, RenameAndUniquify(_, _)) | 2139 EXPECT_CALL(*file_, RenameAndUniquify(_, _)) |
2101 .WillOnce(DoAll(SaveArg<1>(&intermediate_rename_callback), | 2140 .WillOnce(DoAll(SaveArg<1>(&intermediate_rename_callback), |
2102 ScheduleClosure(intermediate_rename_loop.QuitClosure()))); | 2141 ScheduleClosure(intermediate_rename_loop.QuitClosure()))); |
2103 | 2142 |
2104 base::RunLoop download_start_loop; | 2143 base::RunLoop download_start_loop; |
2105 DownloadFile::InitializeCallback initialize_callback; | 2144 DownloadFile::InitializeCallback initialize_callback; |
2106 EXPECT_CALL(*file_, Initialize(_)) | 2145 EXPECT_CALL(*file_, Initialize(_, _)) |
2107 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), | 2146 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), |
2108 ScheduleClosure(download_start_loop.QuitClosure()))); | 2147 ScheduleClosure(download_start_loop.QuitClosure()))); |
2109 | 2148 |
2110 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); | 2149 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); |
2111 download_start_loop.Run(); | 2150 download_start_loop.Run(); |
2112 base::WeakPtr<DownloadDestinationObserver> destination_observer = | 2151 base::WeakPtr<DownloadDestinationObserver> destination_observer = |
2113 item_->DestinationObserverAsWeakPtr(); | 2152 item_->DestinationObserverAsWeakPtr(); |
2114 | 2153 |
2115 ScheduleObservations(PreInitializeFileObservations(), destination_observer); | 2154 ScheduleObservations(PreInitializeFileObservations(), destination_observer); |
2116 RunAllPendingInMessageLoops(); | 2155 RunAllPendingInMessageLoops(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 // DownloadFile expectations since we are about to transfer its ownership to | 2205 // DownloadFile expectations since we are about to transfer its ownership to |
2167 // the DownloadItem. | 2206 // the DownloadItem. |
2168 base::RunLoop intermediate_rename_loop; | 2207 base::RunLoop intermediate_rename_loop; |
2169 DownloadFile::RenameCompletionCallback intermediate_rename_callback; | 2208 DownloadFile::RenameCompletionCallback intermediate_rename_callback; |
2170 EXPECT_CALL(*file_, RenameAndUniquify(_, _)) | 2209 EXPECT_CALL(*file_, RenameAndUniquify(_, _)) |
2171 .WillOnce(DoAll(SaveArg<1>(&intermediate_rename_callback), | 2210 .WillOnce(DoAll(SaveArg<1>(&intermediate_rename_callback), |
2172 ScheduleClosure(intermediate_rename_loop.QuitClosure()))); | 2211 ScheduleClosure(intermediate_rename_loop.QuitClosure()))); |
2173 | 2212 |
2174 base::RunLoop download_start_loop; | 2213 base::RunLoop download_start_loop; |
2175 DownloadFile::InitializeCallback initialize_callback; | 2214 DownloadFile::InitializeCallback initialize_callback; |
2176 EXPECT_CALL(*file_, Initialize(_)) | 2215 EXPECT_CALL(*file_, Initialize(_, _)) |
2177 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), | 2216 .WillOnce(DoAll(SaveArg<0>(&initialize_callback), |
2178 ScheduleClosure(download_start_loop.QuitClosure()))); | 2217 ScheduleClosure(download_start_loop.QuitClosure()))); |
2179 | 2218 |
2180 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); | 2219 item_->Start(std::move(file_), std::move(request_handle_), *create_info()); |
2181 download_start_loop.Run(); | 2220 download_start_loop.Run(); |
2182 base::WeakPtr<DownloadDestinationObserver> destination_observer = | 2221 base::WeakPtr<DownloadDestinationObserver> destination_observer = |
2183 item_->DestinationObserverAsWeakPtr(); | 2222 item_->DestinationObserverAsWeakPtr(); |
2184 | 2223 |
2185 ScheduleObservations(PreInitializeFileObservations(), destination_observer); | 2224 ScheduleObservations(PreInitializeFileObservations(), destination_observer); |
2186 RunAllPendingInMessageLoops(); | 2225 RunAllPendingInMessageLoops(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2232 | 2271 |
2233 item_->Cancel(true); | 2272 item_->Cancel(true); |
2234 RunAllPendingInMessageLoops(); | 2273 RunAllPendingInMessageLoops(); |
2235 } | 2274 } |
2236 | 2275 |
2237 TEST(MockDownloadItem, Compiles) { | 2276 TEST(MockDownloadItem, Compiles) { |
2238 MockDownloadItem mock_item; | 2277 MockDownloadItem mock_item; |
2239 } | 2278 } |
2240 | 2279 |
2241 } // namespace content | 2280 } // namespace content |
OLD | NEW |