OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/background_fetch/background_fetch_test_base.h" | 5 #include "content/browser/background_fetch/background_fetch_test_base.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 // Temporary directory in which successfully downloaded files will be stored. | 195 // Temporary directory in which successfully downloaded files will be stored. |
196 base::ScopedTempDir temp_directory_; | 196 base::ScopedTempDir temp_directory_; |
197 | 197 |
198 base::WeakPtrFactory<RespondingDownloadManager> weak_ptr_factory_; | 198 base::WeakPtrFactory<RespondingDownloadManager> weak_ptr_factory_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(RespondingDownloadManager); | 200 DISALLOW_COPY_AND_ASSIGN(RespondingDownloadManager); |
201 }; | 201 }; |
202 | 202 |
203 BackgroundFetchTestBase::BackgroundFetchTestBase() | 203 BackgroundFetchTestBase::BackgroundFetchTestBase() |
| 204 // Using REAL_IO_THREAD would give better coverage for thread safety, but |
| 205 // at time of writing EmbeddedWorkerTestHelper didn't seem to support that. |
204 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), | 206 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), |
205 origin_(GURL(kTestOrigin)) {} | 207 origin_(GURL(kTestOrigin)) {} |
206 | 208 |
207 BackgroundFetchTestBase::~BackgroundFetchTestBase() { | 209 BackgroundFetchTestBase::~BackgroundFetchTestBase() { |
208 DCHECK(set_up_called_); | 210 DCHECK(set_up_called_); |
209 DCHECK(tear_down_called_); | 211 DCHECK(tear_down_called_); |
210 } | 212 } |
211 | 213 |
212 void BackgroundFetchTestBase::SetUp() { | 214 void BackgroundFetchTestBase::SetUp() { |
213 download_manager_ = new RespondingDownloadManager(); | 215 download_manager_ = new RespondingDownloadManager(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // Create a ServiceWorkerFetchRequest request with the same information. | 295 // Create a ServiceWorkerFetchRequest request with the same information. |
294 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), | 296 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), |
295 Referrer(), false /* is_reload */); | 297 Referrer(), false /* is_reload */); |
296 } | 298 } |
297 | 299 |
298 MockDownloadManager* BackgroundFetchTestBase::download_manager() { | 300 MockDownloadManager* BackgroundFetchTestBase::download_manager() { |
299 return download_manager_; | 301 return download_manager_; |
300 } | 302 } |
301 | 303 |
302 } // namespace content | 304 } // namespace content |
OLD | NEW |