[Wi-Fi] Use getUriHelpString() result to judge if Settings APP should register the help button click event and file related intent if need.
The Openroaming help button should show only when the getHelpUriString() value is not null, and need to handle the click event in Settings APP. Bug: 146669261 Test: Adjust unit test cases: 1. make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest 2. make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettings2Test Change-Id: I27a717c3014b01cc464908bac56f64bd08aa5da3
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user