Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java

Issue 2830843002: [Offline pages] Updates to background scheduling to use BTS (Closed)
Patch Set: Fixing the crash on NCN not being initialized Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java
deleted file mode 100644
index f1f94206052be14e052e0431a862df82532c6fce..0000000000000000000000000000000000000000
--- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.offlinepages;
-
-import com.google.android.gms.gcm.GcmNetworkManager;
-import com.google.android.gms.gcm.GcmTaskService;
-import com.google.android.gms.gcm.Task;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-
-/**
- * Custom shadow for the OS's GcmNetworkManager. We use this to hook the call to GcmNetworkManager
- * to make sure it was invoked as we expect.
- */
-@Implements(GcmNetworkManager.class)
-public class ShadowGcmNetworkManager {
- private Task mTask;
- private Task mCanceledTask;
-
- @Implementation
- public void schedule(Task task) {
- // Capture the string part divisions so we can check them.
- mTask = task;
- }
-
- @Implementation
- public void cancelTask(String tag, Class<? extends GcmTaskService> gcmTaskService) {
- if (mTask != null && mTask.getTag().equals(tag)
- && mTask.getServiceName().equals(gcmTaskService.getName())) {
- mCanceledTask = mTask;
- mTask = null;
- }
- }
-
- public Task getScheduledTask() {
- return mTask;
- }
-
- public Task getCanceledTask() {
- return mCanceledTask;
- }
-
- public void clear() {
- mTask = null;
- mCanceledTask = null;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698