| 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 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Returns the browser context that should be used for the tests. | 94 // Returns the browser context that should be used for the tests. |
| 95 BrowserContext* browser_context() { return &browser_context_; } | 95 BrowserContext* browser_context() { return &browser_context_; } |
| 96 | 96 |
| 97 // Returns the download manager used for the tests. | 97 // Returns the download manager used for the tests. |
| 98 MockDownloadManager* download_manager(); | 98 MockDownloadManager* download_manager(); |
| 99 | 99 |
| 100 // Returns the origin that should be used for Background Fetch tests. | 100 // Returns the origin that should be used for Background Fetch tests. |
| 101 const url::Origin& origin() const { return origin_; } | 101 const url::Origin& origin() const { return origin_; } |
| 102 | 102 |
| 103 protected: |
| 104 TestBrowserThreadBundle thread_bundle_; // Must be first member. |
| 105 |
| 103 private: | 106 private: |
| 104 class RespondingDownloadManager; | 107 class RespondingDownloadManager; |
| 105 | 108 |
| 106 TestBrowserThreadBundle thread_bundle_; | |
| 107 TestBrowserContext browser_context_; | 109 TestBrowserContext browser_context_; |
| 108 | 110 |
| 109 RespondingDownloadManager* download_manager_; // owned by |browser_context_| | 111 RespondingDownloadManager* download_manager_; // owned by |browser_context_| |
| 110 | 112 |
| 111 BackgroundFetchEmbeddedWorkerTestHelper embedded_worker_test_helper_; | 113 BackgroundFetchEmbeddedWorkerTestHelper embedded_worker_test_helper_; |
| 112 | 114 |
| 113 url::Origin origin_; | 115 url::Origin origin_; |
| 114 | 116 |
| 115 // Vector of ServiceWorkerRegistration instances that have to be kept alive | 117 // Vector of ServiceWorkerRegistration instances that have to be kept alive |
| 116 // for the lifetime of this test. | 118 // for the lifetime of this test. |
| 117 std::vector<scoped_refptr<ServiceWorkerRegistration>> | 119 std::vector<scoped_refptr<ServiceWorkerRegistration>> |
| 118 service_worker_registrations_; | 120 service_worker_registrations_; |
| 119 | 121 |
| 120 bool set_up_called_ = false; | 122 bool set_up_called_ = false; |
| 121 bool tear_down_called_ = false; | 123 bool tear_down_called_ = false; |
| 122 | 124 |
| 123 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchTestBase); | 125 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchTestBase); |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 } // namespace content | 128 } // namespace content |
| 127 | 129 |
| 128 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ | 130 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_TEST_BASE_H_ |
| OLD | NEW |