OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ | 5 #ifndef CONTENT_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ |
6 #define CONTENT_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ | 6 #define CONTENT_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "content/browser/background_sync/background_sync_manager.h" | 15 #include "content/browser/background_sync/background_sync_manager.h" |
16 #include "content/browser/service_worker/service_worker_storage.h" | 16 #include "content/browser/service_worker/service_worker_storage.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class TimeDelta; | 21 class TimeDelta; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 class BackgroundSyncNetworkObserver; | |
27 struct BackgroundSyncParameters; | 26 struct BackgroundSyncParameters; |
28 class BackgroundSyncPowerObserver; | |
29 class ServiceWorkerContextWrapper; | 27 class ServiceWorkerContextWrapper; |
30 class ServiceWorkerVersion; | 28 class ServiceWorkerVersion; |
31 | 29 |
32 // A BackgroundSyncManager for use in unit tests. This class provides control | 30 // A BackgroundSyncManager for use in unit tests. This class provides control |
33 // over internal behavior and state, to allow tests to simulate various | 31 // over internal behavior and state, to allow tests to simulate various |
34 // scenarios. Examples include (but are not limited to): | 32 // scenarios. Examples include (but are not limited to): |
35 // - Delaying and corrupting the backend storage. | 33 // - Delaying and corrupting the backend storage. |
36 // - Controlling the firing of service worker onsync events. | 34 // - Controlling the firing of service worker onsync events. |
37 // - Setting the network state | 35 // - Setting the network state |
38 class TestBackgroundSyncManager : public BackgroundSyncManager { | 36 class TestBackgroundSyncManager : public BackgroundSyncManager { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 DispatchSyncCallback dispatch_sync_callback_; | 144 DispatchSyncCallback dispatch_sync_callback_; |
147 base::Closure delayed_task_; | 145 base::Closure delayed_task_; |
148 base::TimeDelta delayed_task_delta_; | 146 base::TimeDelta delayed_task_delta_; |
149 | 147 |
150 DISALLOW_COPY_AND_ASSIGN(TestBackgroundSyncManager); | 148 DISALLOW_COPY_AND_ASSIGN(TestBackgroundSyncManager); |
151 }; | 149 }; |
152 | 150 |
153 } // namespace content | 151 } // namespace content |
154 | 152 |
155 #endif // CONTENT_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ | 153 #endif // CONTENT_TEST_TEST_BACKGROUND_SYNC_MANAGER_H_ |
OLD | NEW |