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 package org.chromium.chrome.browser.offlinepages; | 5 package org.chromium.chrome.browser.offlinepages; |
6 | 6 |
7 import com.google.android.gms.gcm.GcmNetworkManager; | 7 import com.google.android.gms.gcm.GcmNetworkManager; |
8 import com.google.android.gms.gcm.GcmTaskService; | 8 import com.google.android.gms.gcm.GcmTaskService; |
9 import com.google.android.gms.gcm.Task; | 9 import com.google.android.gms.gcm.Task; |
10 | 10 |
11 import org.robolectric.annotation.Implementation; | 11 import org.robolectric.annotation.Implementation; |
12 import org.robolectric.annotation.Implements; | 12 import org.robolectric.annotation.Implements; |
13 | 13 |
14 | |
15 /** | 14 /** |
16 * Custom shadow for the OS's GcmNetworkManager. We use this to hook the call t
o GcmNetworkManager | 15 * Custom shadow for the OS's GcmNetworkManager. We use this to hook the call t
o GcmNetworkManager |
17 * to make sure it was invoked as we expect. | 16 * to make sure it was invoked as we expect. |
18 */ | 17 */ |
19 @Implements(GcmNetworkManager.class) | 18 @Implements(GcmNetworkManager.class) |
20 public class ShadowGcmNetworkManager { | 19 public class ShadowGcmNetworkManager { |
21 private Task mTask; | 20 private Task mTask; |
22 private Task mCanceledTask; | 21 private Task mCanceledTask; |
23 | 22 |
24 @Implementation | 23 @Implementation |
(...skipping 17 matching lines...) Expand all Loading... |
42 | 41 |
43 public Task getCanceledTask() { | 42 public Task getCanceledTask() { |
44 return mCanceledTask; | 43 return mCanceledTask; |
45 } | 44 } |
46 | 45 |
47 public void clear() { | 46 public void clear() { |
48 mTask = null; | 47 mTask = null; |
49 mCanceledTask = null; | 48 mCanceledTask = null; |
50 } | 49 } |
51 } | 50 } |
OLD | NEW |