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

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

Issue 2053713002: Turn on the BackgroundScheduler test that was flaky, so we can (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused @Config() 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/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java
index 8c357117cfa689332e955cf85939a1424214fb45..02b34952581fa5f36333e98bc20f5c6b0c212b7b 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.offlinepages;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import android.content.Context;
@@ -22,7 +23,8 @@ import org.robolectric.annotation.Config;
*/
@RunWith(LocalRobolectricTestRunner.class)
@Config(manifest = Config.NONE,
- application = BaseChromiumApplication.class)
+ application = BaseChromiumApplication.class,
+ shadows = {ShadowGcmNetworkManager.class})
public class BackgroundSchedulerTest {
private Context mContext;
@@ -32,14 +34,13 @@ public class BackgroundSchedulerTest {
}
@Test
- @Config(shadows = {ShadowGcmNetworkManager.class})
@Feature({"OfflinePages"})
public void testSchedule() {
BackgroundScheduler scheduler = new BackgroundScheduler();
assertNull(ShadowGcmNetworkManager.getScheduledTask());
-
- // TODO(petewil): Re-enable the test when I track down why the GCMNetworkManager shadow is
- // flaky. I will need to call schedule, then assert that the shadow saw the scheduled task.
+ scheduler.schedule(mContext);
+ // Check with gcmNetworkManagerShadow that schedule got called.
+ assertNotNull(ShadowGcmNetworkManager.getScheduledTask());
// TODO(petewil): Also assert that the date we see is what we expected
}
« no previous file with comments | « no previous file | chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/ShadowGcmNetworkManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698