use of com.android.settingslib.core.lifecycle.events.OnStart in project android_packages_apps_Settings by omnirom.
the class ContextualCardManagerTest method onWindowFocusChanged_hasFocusAndHasConditionals_startMonitoringConditionCard.
@Test
public void onWindowFocusChanged_hasFocusAndHasConditionals_startMonitoringConditionCard() {
mManager.mContextualCards.add(new ConditionalContextualCard.Builder().build());
mManager.mContextualCards.add(new ConditionFooterContextualCard.Builder().build());
final ContextualCardManager manager = spy(mManager);
final ControllerRendererPool pool = spy(mManager.mControllerRendererPool);
doReturn(pool).when(manager).getControllerRendererPool();
final ConditionContextualCardController conditionController = pool.getController(mContext, ContextualCard.CardType.CONDITIONAL);
final OnStart controller = spy((OnStart) conditionController);
doReturn(controller).when(pool).getController(mContext, ContextualCard.CardType.CONDITIONAL);
manager.onWindowFocusChanged(true);
verify(controller, atLeast(2)).onStart();
}
use of com.android.settingslib.core.lifecycle.events.OnStart in project android_packages_apps_Settings by omnirom.
the class ContextualCardManagerTest method onWindowFocusChanged_hasFocusAndNoConditional_startMonitoringConditionCard.
@Test
public void onWindowFocusChanged_hasFocusAndNoConditional_startMonitoringConditionCard() {
final ContextualCardManager manager = spy(mManager);
final ControllerRendererPool pool = spy(mManager.mControllerRendererPool);
doReturn(pool).when(manager).getControllerRendererPool();
final ConditionContextualCardController conditionController = pool.getController(mContext, ContextualCard.CardType.CONDITIONAL);
final OnStart controller = spy((OnStart) conditionController);
doReturn(controller).when(pool).getController(mContext, ContextualCard.CardType.CONDITIONAL);
manager.onWindowFocusChanged(true);
verify(controller, atLeast(1)).onStart();
}
use of com.android.settingslib.core.lifecycle.events.OnStart in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ContextualCardManagerTest method onWindowFocusChanged_hasFocusAndNoConditional_startMonitoringConditionCard.
@Test
public void onWindowFocusChanged_hasFocusAndNoConditional_startMonitoringConditionCard() {
final ContextualCardManager manager = spy(mManager);
final ControllerRendererPool pool = spy(mManager.mControllerRendererPool);
doReturn(pool).when(manager).getControllerRendererPool();
final ConditionContextualCardController conditionController = pool.getController(mContext, ContextualCard.CardType.CONDITIONAL);
final OnStart controller = spy((OnStart) conditionController);
doReturn(controller).when(pool).getController(mContext, ContextualCard.CardType.CONDITIONAL);
manager.onWindowFocusChanged(true);
verify(controller, atLeast(1)).onStart();
}
use of com.android.settingslib.core.lifecycle.events.OnStart in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ContextualCardManagerTest method onWindowFocusChanged_hasFocusAndHasConditionals_startMonitoringConditionCard.
@Test
public void onWindowFocusChanged_hasFocusAndHasConditionals_startMonitoringConditionCard() {
mManager.mContextualCards.add(new ConditionalContextualCard.Builder().build());
mManager.mContextualCards.add(new ConditionFooterContextualCard.Builder().build());
final ContextualCardManager manager = spy(mManager);
final ControllerRendererPool pool = spy(mManager.mControllerRendererPool);
doReturn(pool).when(manager).getControllerRendererPool();
final ConditionContextualCardController conditionController = pool.getController(mContext, ContextualCard.CardType.CONDITIONAL);
final OnStart controller = spy((OnStart) conditionController);
doReturn(controller).when(pool).getController(mContext, ContextualCard.CardType.CONDITIONAL);
manager.onWindowFocusChanged(true);
verify(controller, atLeast(2)).onStart();
}
Aggregations