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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.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/StubBackgroundSchedulerProcessor.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.java
deleted file mode 100644
index 3951d5e4ab31f490df6f775454baee61f713bf01..0000000000000000000000000000000000000000
--- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/StubBackgroundSchedulerProcessor.java
+++ /dev/null
@@ -1,52 +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 org.chromium.base.Callback;
-import org.chromium.chrome.browser.offlinepages.interfaces.BackgroundSchedulerProcessor;
-
-/**
- * Custom stub for our own BackgroundSchedulerRequestProcessor.
- */
-public class StubBackgroundSchedulerProcessor implements BackgroundSchedulerProcessor {
- private boolean mFailToStart;
- private boolean mDidStartProcessing;
- private DeviceConditions mDeviceConditions;
- private Callback<Boolean> mCallback;
-
- public void setFailToStart(boolean failToStart) {
- mFailToStart = failToStart;
- }
-
- public boolean getDidStartProcessing() {
- return mDidStartProcessing;
- }
-
- public DeviceConditions getDeviceConditions() {
- return mDeviceConditions;
- }
-
- public void callback() {
- mCallback.onResult(true);
- }
-
- @Override
- public boolean startScheduledProcessing(
- DeviceConditions deviceConditions, Callback<Boolean> callback) {
- if (mFailToStart) {
- return false;
- }
-
- mDidStartProcessing = true;
- mDeviceConditions = deviceConditions;
- mCallback = callback;
- return true;
- }
-
- @Override
- public boolean stopScheduledProcessing() {
- return true;
- }
-}

Powered by Google App Engine
This is Rietveld 408576698