initializingSwitchDoesNotTriggerView initializes mController with a mSwitchBar which has already addOnSwitchChangeListener, it will trigger onSwitchChangedon (and a dialog breaks the test) of a mController initialized at setUp(). This change initializes a new mSwitchBar for the test. Bug: 214907475 Test: make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagerSwitchBarControllerTest Change-Id: Iefe56387c56ca6b1c2520c050467d130182ccfdc
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.