Convert SettingsLib Lifecycle to Flatfoot

Bug: 69257739
Test: m -j RunSettingsRoboTests
Change-Id: I27e7850c39afb9c09297007e8cc352f410665653
This commit is contained in:
Tony Mantler
2017-11-10 13:14:50 -08:00
parent 4f74ed2d07
commit 94a7c7d21c
45 changed files with 257 additions and 143 deletions

View File

@@ -17,7 +17,10 @@
package com.android.settings.fuelgauge;
import static android.arch.lifecycle.Lifecycle.Event.ON_START;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
@@ -90,7 +93,7 @@ public class BatteryHeaderPreferenceControllerTest {
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
mLifecycle = new Lifecycle(() -> mLifecycle);
mContext = spy(RuntimeEnvironment.application);
mBatteryMeterView = new BatteryMeterView(mContext);
mBatteryPercentText = new TextView(mContext);
@@ -170,7 +173,7 @@ public class BatteryHeaderPreferenceControllerTest {
.thenReturn(mEntityHeaderController);
mController.displayPreference(mPreferenceScreen);
mLifecycle.onStart();
mLifecycle.handleLifecycleEvent(ON_START);
verify(mEntityHeaderController).styleActionBar(mActivity);
}