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 // TODO(johnme): Make this REAL_IO_THREAD to get coverage for thread safety. | |
Peter Beverloo
2017/07/10 13:13:21
Is that ever going to happen? OK if you plan to wo
johnme
2017/07/10 13:41:07
Changed this to explain why it's not REAL_IO_THREA
| |
204 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), | 205 : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), |
205 origin_(GURL(kTestOrigin)) {} | 206 origin_(GURL(kTestOrigin)) {} |
206 | 207 |
207 BackgroundFetchTestBase::~BackgroundFetchTestBase() { | 208 BackgroundFetchTestBase::~BackgroundFetchTestBase() { |
208 DCHECK(set_up_called_); | 209 DCHECK(set_up_called_); |
209 DCHECK(tear_down_called_); | 210 DCHECK(tear_down_called_); |
210 } | 211 } |
211 | 212 |
212 void BackgroundFetchTestBase::SetUp() { | 213 void BackgroundFetchTestBase::SetUp() { |
213 download_manager_ = new RespondingDownloadManager(); | 214 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. | 294 // Create a ServiceWorkerFetchRequest request with the same information. |
294 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), | 295 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), |
295 Referrer(), false /* is_reload */); | 296 Referrer(), false /* is_reload */); |
296 } | 297 } |
297 | 298 |
298 MockDownloadManager* BackgroundFetchTestBase::download_manager() { | 299 MockDownloadManager* BackgroundFetchTestBase::download_manager() { |
299 return download_manager_; | 300 return download_manager_; |
300 } | 301 } |
301 | 302 |
302 } // namespace content | 303 } // namespace content |
OLD | NEW |