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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java

Issue 1874423002: 🍰 Migrate app 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: chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
index 9a81275ef19ea9fe1df4e06cd254e8d7941a7a49..c4980f86f435fd8f9975f80e029820031735a020 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
@@ -10,10 +10,10 @@ import android.content.SharedPreferences;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
-import android.preference.PreferenceManager;
import android.test.ServiceTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
@@ -113,7 +113,7 @@ public class DownloadNotificationServiceTest extends
notifications.add(new DownloadSharedPreferenceEntry(2, true, true,
UUID.randomUUID().toString(), "test2").getSharedPreferenceString());
SharedPreferences sharedPrefs =
- PreferenceManager.getDefaultSharedPreferences(mockContext);
+ ContextUtils.getAppSharedPreferences();
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putStringSet(
DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS, notifications);
@@ -143,7 +143,7 @@ public class DownloadNotificationServiceTest extends
String guid2 = UUID.randomUUID().toString();
notifications.add(new DownloadSharedPreferenceEntry(4, true, true, guid2, "failed")
.getSharedPreferenceString());
- SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(mockContext);
+ SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putStringSet(
DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS, notifications);
@@ -193,7 +193,7 @@ public class DownloadNotificationServiceTest extends
String guid2 = UUID.randomUUID().toString();
notifications.add(new DownloadSharedPreferenceEntry(4, true, true, guid2, "failed")
.getSharedPreferenceString());
- SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(mockContext);
+ SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putStringSet(
DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS, notifications);

Powered by Google App Engine
This is Rietveld 408576698