Files
app_Settings/tests/unit
Arc Wang 7bdcadbe72 Handle different error codes in DPP
Show error message for corresponding Wi-Fi DPP error code. And

1. To update error message only from each fragment,
   remove some callbacks which calls from fragment to activity.
2. After clicking 'Share Wi-Fi' button, hide it before Wi-Fi DPP handshake completes.
3. Show 'Done' button for some error codes.
4. Use ViewModel to call startEasyConnectAsConfiguratorInitiator and
   startEasyConnectAsEnrolleeInitiator because a lifecycle object
   does not receive an Executor callback after configurator change.
5. In WifiDppQrCodeScannerFragment, show an error message for 10s instead of 2s
   since new added error messages may carry more information.
6. Show a different error message for enrollee handshake success but Wi-Fi
   connection fail case.
7. stop camera when scanned a Wi-Fi DPP QR code for enrollee.
8. In QR code scanner fragment, support to show error message after
    configuration change.

Bug: 124247872
Bug: 124491247
Test: manual test
      atest WifiQrCodeTest
      atest WifiDppConfiguratorActivityTest
      atest WifiDppEnrolleeActivityTest
      atest WifiDppQrCodeGeneratorFragmentTest
      atest WifiDppQrCodeScannerFragmentTest
      atest WifiNetworkListFragmentTest
      atest WifiDppChooseSavedWifiNetworkFragmentTest

Change-Id: Id130215e9ddafac8bc4c68238deda48ce99b4255
2019-02-20 14:28:52 +08:00
..

To build the tests you can use the following command at the root of your android source tree
$ make SettingsUnitTests

The test apk then needs to be installed onto your test device via for example
$ adb install -r out/target/product/shamu/data/app/SettingsUnitTests/SettingsUnitTests.apk

To run all tests:
$ adb shell am instrument -w com.android.settings.tests.unit/androidx.test.runner.AndroidJUnitRunner

To run all tests in a specific class:
$ adb shell am instrument -w -e class com.android.settings.<class> com.android.settings.tests.unit/androidx.test.runner.AndroidJUnitRunner

To run a specific test:
$ adb shell am instrument -w -e class com.android.settings.<class>#<test> com.android.settings.tests.unit/androidx.test.runner.AndroidJUnitRunner

More general information can be found at
http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html