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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java

Issue 2030773002: Add unit tests for the Background Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable flaky test Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
index 4b988402734e78d1f374a5675d9af4ce131110a1..f408bc18d9ad990c7c9cc6373e3e7a721f92ab38 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackgroundService.java
@@ -15,11 +15,13 @@ import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher;
import org.chromium.chrome.browser.offlinepages.BackgroundOfflinerTask;
+import org.chromium.chrome.browser.offlinepages.BackgroundSchedulerProcessorImpl;
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
import org.chromium.chrome.browser.precache.PrecacheController;
@@ -125,13 +127,16 @@ public class ChromeBackgroundService extends GcmTaskService {
PrecacheController.get(context).precache(tag);
}
- private void handleOfflinePageBackgroundLoad(Context context, Bundle bundle) {
- if (!hasPrecacheInstance()) {
+ @VisibleForTesting
+ protected void handleOfflinePageBackgroundLoad(Context context, Bundle bundle) {
+ if (!LibraryLoader.isInitialized()) {
launchBrowser(context);
}
// Call BackgroundTask, provide context.
- BackgroundOfflinerTask.startBackgroundRequests(context, bundle);
+ BackgroundOfflinerTask task =
+ new BackgroundOfflinerTask(new BackgroundSchedulerProcessorImpl());
+ task.startBackgroundRequests(context, bundle);
// TODO(petewil) if processBackgroundRequest returns false, return RESTART_RESCHEDULE
// to the GcmNetworkManager
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTask.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698