Home
last modified time | relevance | path

Searched refs:mStateManager (Results 1 – 4 of 4) sorted by relevance

/cts/common/device-side/util-axt/tests/src/com/android/compatibility/common/util/
DStateChangerRuleTest.java45 private StateManager<String> mStateManager; field in StateChangerRuleTest
58 final StateChangerRule<String> rule = new StateChangerRule<>(mStateManager, in testSetAndRestoreOnSuccess()
60 when(mStateManager.get()).thenReturn("before", "changed"); in testSetAndRestoreOnSuccess()
65 verify(mStateManager, times(2)).get(); // Needed because of verifyNoMoreInteractions() in testSetAndRestoreOnSuccess()
66 verify(mStateManager, times(1)).set("newValue"); in testSetAndRestoreOnSuccess()
67 verify(mStateManager, times(1)).set("before"); in testSetAndRestoreOnSuccess()
68 verifyNoMoreInteractions(mStateManager); // Make sure set() was not called again in testSetAndRestoreOnSuccess()
73 final StateChangerRule<String> rule = new StateChangerRule<>(mStateManager, in testDontSetIfSameValueOnSuccess()
75 when(mStateManager.get()).thenReturn("sameValue"); in testDontSetIfSameValueOnSuccess()
80 verify(mStateManager, never()).set(anyString()); in testDontSetIfSameValueOnSuccess()
[all …]
DStateKeeperRuleTest.java45 private StateManager<String> mStateManager; field in StateKeeperRuleTest
57 final StateKeeperRule<String> rule = new StateKeeperRule<>(mStateManager); in testRestoreOnSuccess()
58 when(mStateManager.get()).thenReturn("before", "changed"); in testRestoreOnSuccess()
63 verify(mStateManager, times(2)).get(); // Needed because of verifyNoMoreInteractions() in testRestoreOnSuccess()
64 verify(mStateManager, times(1)).set("before"); in testRestoreOnSuccess()
65 verifyNoMoreInteractions(mStateManager); // Make sure set() was not called again in testRestoreOnSuccess()
70 final StateKeeperRule<String> rule = new StateKeeperRule<>(mStateManager); in testRestoreOnFailure()
71 when(mStateManager.get()).thenReturn("before", "changed"); in testRestoreOnFailure()
78 verify(mStateManager, times(2)).get(); // Needed because of verifyNoMoreInteractions() in testRestoreOnFailure()
79 verify(mStateManager, times(1)).set("before"); in testRestoreOnFailure()
[all …]
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DStateChangerRule.java38 private final StateManager<T> mStateManager; field in StateChangerRule
48 mStateManager = Objects.requireNonNull(stateManager); in StateChangerRule()
58 final T previousValue = mStateManager.get(); in apply()
60 mStateManager.set(mValue); in apply()
65 final T currentValue = mStateManager.get(); in apply()
67 mStateManager.set(previousValue); in apply()
DStateKeeperRule.java36 private final StateManager<T> mStateManager; field in StateKeeperRule
44 mStateManager = Objects.requireNonNull(stateManager); in StateKeeperRule()
65 final T previousValue = mStateManager.get(); in apply()
70 final T currentValue = mStateManager.get(); in apply()
72 mStateManager.set(previousValue); in apply()