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

Unified Diff: components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java

Issue 2804043002: Enable variations restrict param for Java-side fetches. (Closed)
Patch Set: Addressed comments. Created 3 years, 8 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: components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java
diff --git a/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java b/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java
index 1835e1ea53347109705da60f0c910198870c1baf..5cad3a2b1854d7df82923dbf658b044c21ed7c86 100644
--- a/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java
+++ b/components/variations/android/junit/src/org/chromium/components/variations/firstrun/VariationsSeedFetcherTest.java
@@ -53,7 +53,7 @@ public class VariationsSeedFetcherTest {
ThreadUtils.setUiThread(mock(Looper.class));
mFetcher = spy(VariationsSeedFetcher.get());
mConnection = mock(HttpURLConnection.class);
- doReturn(mConnection).when(mFetcher).getServerConnection();
+ doReturn(mConnection).when(mFetcher).getServerConnection("");
mPrefs = ContextUtils.getAppSharedPreferences();
mPrefs.edit().clear().apply();
}
@@ -80,7 +80,7 @@ public class VariationsSeedFetcherTest {
when(mConnection.getHeaderField("IM")).thenReturn("gzip");
when(mConnection.getInputStream()).thenReturn(new ByteArrayInputStream("1234".getBytes()));
- mFetcher.fetchSeed();
+ mFetcher.fetchSeed("");
assertThat(mPrefs.getString(VariationsSeedBridge.VARIATIONS_FIRST_RUN_SEED_SIGNATURE, ""),
equalTo("signature"));
@@ -101,7 +101,7 @@ public class VariationsSeedFetcherTest {
public void testFetchSeed_noFetchNeeded() throws IOException {
mPrefs.edit().putBoolean(VariationsSeedFetcher.VARIATIONS_INITIALIZED_PREF, true).apply();
- mFetcher.fetchSeed();
+ mFetcher.fetchSeed("");
verify(mConnection, never()).connect();
}
@@ -113,7 +113,7 @@ public class VariationsSeedFetcherTest {
public void testFetchSeed_badResponse() throws IOException {
when(mConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_NOT_FOUND);
- mFetcher.fetchSeed();
+ mFetcher.fetchSeed("");
assertTrue(mPrefs.getBoolean(VariationsSeedFetcher.VARIATIONS_INITIALIZED_PREF, false));
assertFalse(VariationsSeedBridge.hasJavaPref(ContextUtils.getApplicationContext()));
@@ -126,7 +126,7 @@ public class VariationsSeedFetcherTest {
public void testFetchSeed_IOException() throws IOException {
doThrow(new IOException()).when(mConnection).connect();
- mFetcher.fetchSeed();
+ mFetcher.fetchSeed("");
assertTrue(mPrefs.getBoolean(VariationsSeedFetcher.VARIATIONS_INITIALIZED_PREF, false));
assertFalse(VariationsSeedBridge.hasJavaPref(ContextUtils.getApplicationContext()));

Powered by Google App Engine
This is Rietveld 408576698