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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java

Issue 159173002: Refactor ActivityStatus to not store current activity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to set callback_, fixed unit tests Created 6 years, 10 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/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
index 9a6fb512f0becf4bd58f4aad4d91318eda26f70c..33ca597d47238f8f6029647cfa750c12f58a48d9 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
@@ -79,7 +79,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
public void testResumingMainActivity() throws Exception {
// Resuming main activity should trigger a start if sync is enabled.
setupSync(true);
- mController.onActivityStateChange(ActivityStatus.RESUMED);
+ mController.onApplicationStateChange(ActivityStatus.HAS_RUNNING_ACTIVITIES);
assertEquals(1, mContext.getNumStartedIntents());
Intent intent = mContext.getStartedIntent(0);
validateIntentComponent(intent);
@@ -90,7 +90,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
public void testResumingMainActivityWithSyncDisabled() throws Exception {
// Resuming main activity should NOT trigger a start if sync is disabled.
setupSync(false);
- mController.onActivityStateChange(ActivityStatus.RESUMED);
+ mController.onApplicationStateChange(ActivityStatus.HAS_RUNNING_ACTIVITIES);
assertEquals(0, mContext.getNumStartedIntents());
}
@@ -99,7 +99,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
public void testPausingMainActivity() throws Exception {
// Resuming main activity should trigger a stop if sync is enabled.
setupSync(true);
- mController.onActivityStateChange(ActivityStatus.PAUSED);
+ mController.onApplicationStateChange(ActivityStatus.HAS_ONLY_PAUSED_ACTIVITIES);
assertEquals(1, mContext.getNumStartedIntents());
Intent intent = mContext.getStartedIntent(0);
validateIntentComponent(intent);
@@ -113,7 +113,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
public void testPausingMainActivityWithSyncDisabled() throws Exception {
// Resuming main activity should NOT trigger a stop if sync is disabled.
setupSync(false);
- mController.onActivityStateChange(ActivityStatus.PAUSED);
+ mController.onApplicationStateChange(ActivityStatus.HAS_ONLY_PAUSED_ACTIVITIES);
assertEquals(0, mContext.getNumStartedIntents());
}
@@ -137,7 +137,7 @@ public class InvalidationControllerTest extends InstrumentationTestCase {
// Create instance.
new InvalidationController(mContext) {
@Override
- public void onActivityStateChange(int newState) {
+ public void onApplicationStateChange(int newState) {
listenerCallbackCalled.set(true);
}
};

Powered by Google App Engine
This is Rietveld 408576698