| 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.test.InstrumentationTestCase; | 9 import android.test.InstrumentationTestCase; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | |
| 10 | 10 |
| 11 import com.google.android.gms.gcm.TaskParams; | 11 import com.google.android.gms.gcm.TaskParams; |
| 12 | 12 |
| 13 import org.chromium.base.ContextUtils; | 13 import org.chromium.base.ContextUtils; |
| 14 import org.chromium.base.ThreadUtils; | 14 import org.chromium.base.ThreadUtils; |
| 15 import org.chromium.base.metrics.RecordHistogram; | 15 import org.chromium.base.metrics.RecordHistogram; |
| 16 import org.chromium.base.test.util.AdvancedMockContext; | 16 import org.chromium.base.test.util.AdvancedMockContext; |
| 17 import org.chromium.base.test.util.Feature; | 17 import org.chromium.base.test.util.Feature; |
| 18 import org.chromium.base.test.util.RetryOnFailure; | 18 import org.chromium.base.test.util.RetryOnFailure; |
| 19 import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher; | 19 import org.chromium.chrome.browser.ntp.snippets.SnippetsLauncher; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 deleteSnippetsLauncherInstance(); | 206 deleteSnippetsLauncherInstance(); |
| 207 // Set the pref indicating that fetching was scheduled before. | 207 // Set the pref indicating that fetching was scheduled before. |
| 208 ContextUtils.getAppSharedPreferences() | 208 ContextUtils.getAppSharedPreferences() |
| 209 .edit() | 209 .edit() |
| 210 .putBoolean(SnippetsLauncher.PREF_IS_SCHEDULED, true) | 210 .putBoolean(SnippetsLauncher.PREF_IS_SCHEDULED, true) |
| 211 .apply(); | 211 .apply(); |
| 212 | 212 |
| 213 startOnInitializeTasksAndVerify(/*shouldStart=*/true, /*shouldReschedule
=*/true); | 213 startOnInitializeTasksAndVerify(/*shouldStart=*/true, /*shouldReschedule
=*/true); |
| 214 } | 214 } |
| 215 } | 215 } |
| OLD | NEW |