Merge "[Wi-Fi] Use getUriHelpString() result to judge if Settings APP should register the help button click event and file related intent if need." into rvc-dev

This commit is contained in:
Goven Liu
2020-04-08 22:37:35 +00:00
committed by Android (Google) Code Review
3 changed files with 11 additions and 13 deletions

View File

@@ -74,6 +74,7 @@ import org.robolectric.shadows.ShadowToast;
public class WifiSettings2Test {
private static final int NUM_NETWORKS = 4;
private static final String FAKE_URI_STRING = "fakeuri";
@Mock
private PowerManager mPowerManager;
@@ -281,10 +282,12 @@ public class WifiSettings2Test {
@Test
public void openSubscriptionHelpPage_shouldCallStartActivityForResult() {
doReturn(new Intent()).when(mWifiSettings2).getHelpIntent(mContext);
doReturn(new Intent()).when(mWifiSettings2).getHelpIntent(mContext, FAKE_URI_STRING);
doNothing().when(mWifiSettings2).startActivityForResult(any(Intent.class), anyInt());
final WifiEntry mockWifiEntry = mock(WifiEntry.class);
when(mockWifiEntry.getHelpUriString()).thenReturn(FAKE_URI_STRING);
mWifiSettings2.openSubscriptionHelpPage();
mWifiSettings2.openSubscriptionHelpPage(mockWifiEntry);
verify(mWifiSettings2, times(1)).startActivityForResult(any(), anyInt());
}