As positions of items will be changed, new sliceViews will be created. SliceLiveData has been set to observe a certain old sliceView. When the page is re-launched, we cannot garantee we always get the same sliceView, which means the sliceLiveData may be still observing a sliveView that is no longer applicable. This will lead to broken slices. Hence, we need to remove observers first then make it observes a new sliceView. Bug: 117922624 Test: robotests, visual Change-Id: I59368a6ce5fa84487c9a4788b970fdc074a0c2a9
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.