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

Unified Diff: sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java

Issue 1965093002: 🎾 Migrate more shared preferences to ContextUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 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: sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
diff --git a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
index 4bcfd20f0844a8a25508da66ef323606d009bd22..c88ba72f975359df2fc5a87886c547490a25e229 100644
--- a/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
+++ b/sync/android/javatests/src/org/chromium/sync/notifier/InvalidationPreferencesTest.java
@@ -5,14 +5,12 @@
package org.chromium.sync.notifier;
import android.accounts.Account;
-import android.content.Context;
import android.test.InstrumentationTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import com.google.ipc.invalidation.external.client.types.ObjectId;
import org.chromium.base.CollectionUtil;
-import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
import java.util.Arrays;
@@ -24,21 +22,13 @@ import java.util.Set;
* @author dsmyers@google.com (Daniel Myers)
*/
public class InvalidationPreferencesTest extends InstrumentationTestCase {
- private Context mContext;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mContext = new AdvancedMockContext(getInstrumentation().getContext());
- }
-
@SmallTest
@Feature({"Sync"})
public void testReadMissingData() {
/*
* Test plan: read saved state from empty preferences. Verify that null is returned.
*/
- InvalidationPreferences invPreferences = new InvalidationPreferences(mContext);
+ InvalidationPreferences invPreferences = new InvalidationPreferences();
assertNull(invPreferences.getSavedSyncedAccount());
assertNull(invPreferences.getSavedSyncedTypes());
assertNull(invPreferences.getSavedObjectIds());
@@ -52,7 +42,7 @@ public class InvalidationPreferencesTest extends InstrumentationTestCase {
* Test plan: write and read back saved state. Verify that the returned state is what
* was written.
*/
- InvalidationPreferences invPreferences = new InvalidationPreferences(mContext);
+ InvalidationPreferences invPreferences = new InvalidationPreferences();
InvalidationPreferences.EditContext editContext = invPreferences.edit();
// Write mix of valid and invalid types to disk to test that preferences are not

Powered by Google App Engine
This is Rietveld 408576698