Upload basic UI files for Wi-Fi DPP Settings development II.

Add 3 fragments:

  WifiDppQrCodeGeneratorFragment
  WifiDppChooseSavedWifiNetworkFragment
  WifiDppAddDeviceFragment

Bug: 118797380
     118797202
     118794978
     118796825
     118794858
Test: atest WifiDppConfiguratorActivityTest
      atest WifiDppQrCodeScannerFragmentTest
      atest atest RunSettingsRoboTests

Change-Id: I2fbc2f46f941d49b63e4ac74d92f94bf617d2b9b
This commit is contained in:
Arc Wang
2018-11-23 10:51:27 +08:00
parent d4fc724f95
commit f5d6089d35
12 changed files with 376 additions and 27 deletions

View File

@@ -35,18 +35,38 @@ public class WifiDppConfiguratorActivityTest {
new ActivityTestRule<>(WifiDppConfiguratorActivity.class);
@Test
public void testLaunchModeQrCodeScanner_shouldNotAutoFinish() {
public void launchActivity_modeQrCodeScanner_shouldNotAutoFinish() {
Intent intent = new Intent();
intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
WifiDppConfiguratorActivity.LaunchMode.LAUNCH_MODE_QR_CODE_SCANNER.getMode());
mActivityRule.launchActivity(intent);
assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
mActivityRule.finishActivity();
}
@Test
public void testNoLaunchMode_shouldFinishActivityWithResultCodeCanceled() {
public void launchActivity_modeQrCodeGenerator_shouldNotAutoFinish() {
Intent intent = new Intent();
intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
WifiDppConfiguratorActivity.LaunchMode.LAUNCH_MODE_QR_CODE_GENERATOR.getMode());
mActivityRule.launchActivity(intent);
assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
}
@Test
public void launchActivity_modeChooseSavedWifiNetwork_shouldNotAutoFinish() {
Intent intent = new Intent();
intent.putExtra(WifiDppConfiguratorActivity.EXTRA_LAUNCH_MODE,
WifiDppConfiguratorActivity.LaunchMode
.LAUNCH_MODE_CHOOSE_SAVED_WIFI_NETWORK.getMode());
mActivityRule.launchActivity(intent);
assertThat(mActivityRule.getActivity().isFinishing()).isEqualTo(false);
}
@Test
public void launchActivity_noLaunchMode_shouldFinishActivityWithResultCodeCanceled() {
// If we do not specify launch mode, the activity will finish itself right away
Intent intent = new Intent();
mActivityRule.launchActivity(intent);

View File

@@ -47,8 +47,9 @@ public class WifiDppQrCodeScannerFragmentTest {
}
@Test
public void testLeftButton_shouldFinishActivityWithResultCodeCanceled() {
public void leftButton_shouldFinishActivityWithResultCodeCanceled() {
onView(withText("Cancel")).perform(click());
assertThat(mActivityRule.getActivityResult().getResultCode()).
isEqualTo(Activity.RESULT_CANCELED);
}