Merge "Update settings tests to use new constructor."

This commit is contained in:
TreeHugger Robot
2017-03-28 00:46:52 +00:00
committed by Android (Google) Code Review
4 changed files with 27 additions and 7 deletions

View File

@@ -68,7 +68,8 @@ public class NetworkScorerPickerPreferenceControllerTest {
Settings.System.putInt(mContext.getContentResolver(), NETWORK_RECOMMENDATIONS_ENABLED, 1);
ComponentName scorer = new ComponentName(TEST_SCORER_PACKAGE, TEST_SCORER_CLASS);
NetworkScorerAppData scorerAppData = new NetworkScorerAppData(
0, scorer, TEST_SCORER_LABEL, null /* enableUseOpenWifiActivity */);
0, scorer, TEST_SCORER_LABEL, null /* enableUseOpenWifiActivity */,
null /* networkAvailableNotificationChannelId */);
when(mNetworkScorer.getActiveScorer()).thenReturn(scorerAppData);
Preference preference = mock(Preference.class);

View File

@@ -118,7 +118,8 @@ public class NetworkScorerPickerTest {
public void testUpdateCandidates_validScorer() {
ComponentName scorer = new ComponentName(TEST_SCORER_PACKAGE_1, TEST_SCORER_CLASS_1);
NetworkScorerAppData scorerAppData = new NetworkScorerAppData(
0, scorer, TEST_SCORER_LABEL_1, null /* enableUseOpenWifiActivity */);
0, scorer, TEST_SCORER_LABEL_1, null /* enableUseOpenWifiActivity */,
null /* networkAvailableNotificationChannelId */);
when(mNetworkScoreManager.getAllValidScorers()).thenReturn(
Lists.newArrayList(scorerAppData));
when(mNetworkScoreManager.getActiveScorerPackage()).thenReturn(TEST_SCORER_PACKAGE_1);

View File

@@ -56,9 +56,9 @@ import org.robolectric.annotation.Config;
public class UseOpenWifiPreferenceControllerTest {
private static ComponentName ENABLE_ACTIVITY_COMPONENT = new ComponentName("package", "activityClass");
private static NetworkScorerAppData APP_DATA =
new NetworkScorerAppData(0, null, null, ENABLE_ACTIVITY_COMPONENT);
new NetworkScorerAppData(0, null, null, ENABLE_ACTIVITY_COMPONENT, null);
private static NetworkScorerAppData APP_DATA_NO_ACTIVITY =
new NetworkScorerAppData(0, null, null, null);
new NetworkScorerAppData(0, null, null, null, null);
@Mock private Lifecycle mLifecycle;
@Mock private Fragment mFragment;