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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.support.test.filters.SmallTest; | 8 import android.support.test.filters.SmallTest; |
9 | 9 |
10 import com.google.android.gms.gcm.TaskParams; | 10 import com.google.android.gms.gcm.TaskParams; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 @Override | 71 @Override |
72 protected void rescheduleBackgroundSyncTasksOnUpgrade() {} | 72 protected void rescheduleBackgroundSyncTasksOnUpgrade() {} |
73 | 73 |
74 @Override | 74 @Override |
75 protected void reschedulePrecacheTasksOnUpgrade() {} | 75 protected void reschedulePrecacheTasksOnUpgrade() {} |
76 | 76 |
77 @Override | 77 @Override |
78 protected void rescheduleOfflinePagesTasksOnUpgrade() {} | 78 protected void rescheduleOfflinePages() {} |
79 | 79 |
80 // Posts an assertion task to the UI thread. Since this is only called a
fter the call | 80 // Posts an assertion task to the UI thread. Since this is only called a
fter the call |
81 // to onRunTask, it will be enqueued after any possible call to launchBr
owser, and we | 81 // to onRunTask, it will be enqueued after any possible call to launchBr
owser, and we |
82 // can reliably check whether launchBrowser was called. | 82 // can reliably check whether launchBrowser was called. |
83 protected void checkExpectations(final boolean expectedLaunchBrowser, | 83 protected void checkExpectations(final boolean expectedLaunchBrowser, |
84 final boolean expectedPrecacheStarted, final boolean expectedFet
chSnippets, | 84 final boolean expectedPrecacheStarted, final boolean expectedFet
chSnippets, |
85 final boolean expectedRescheduleFetching) { | 85 final boolean expectedRescheduleFetching) { |
86 ThreadUtils.runOnUiThread(new Runnable() { | 86 ThreadUtils.runOnUiThread(new Runnable() { |
87 @Override | 87 @Override |
88 public void run() { | 88 public void run() { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 deleteSnippetsLauncherInstance(); | 232 deleteSnippetsLauncherInstance(); |
233 // Set the pref indicating that fetching was scheduled before. | 233 // Set the pref indicating that fetching was scheduled before. |
234 ContextUtils.getAppSharedPreferences() | 234 ContextUtils.getAppSharedPreferences() |
235 .edit() | 235 .edit() |
236 .putBoolean(SnippetsLauncher.PREF_IS_SCHEDULED, true) | 236 .putBoolean(SnippetsLauncher.PREF_IS_SCHEDULED, true) |
237 .apply(); | 237 .apply(); |
238 | 238 |
239 startOnInitializeTasksAndVerify(/*shouldStart=*/true, /*shouldReschedule
=*/true); | 239 startOnInitializeTasksAndVerify(/*shouldStart=*/true, /*shouldReschedule
=*/true); |
240 } | 240 } |
241 } | 241 } |
OLD | NEW |