use of android.view.ActionMode in project android_frameworks_base by DirtyUnicorns.
the class WindowDecorActionBarTest method testStartActionMode.
@UiThreadTest
public void testStartActionMode() {
ActionMode mode = mWindowDecorActionBar.startActionMode(mCallback);
assertNotNull(mode);
assertTrue(mCallback.mIsCreateActionModeCalled);
}
use of android.view.ActionMode in project android_frameworks_base by DirtyUnicorns.
the class WindowDecorActionBarTest method testStartActionModeWhenCreateReturnsFalse.
@UiThreadTest
public void testStartActionModeWhenCreateReturnsFalse() {
mCallback.mShouldCreateActionMode = false;
ActionMode mode = mWindowDecorActionBar.startActionMode(mCallback);
assertNull(mode);
assertTrue(mCallback.mIsCreateActionModeCalled);
}
use of android.view.ActionMode in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindowActionModeTest method testStartActionModeFloatingFinishesPreviousMode.
public void testStartActionModeFloatingFinishesPreviousMode() {
// Use custom callback to control the provided ActionMode.
mWindowCallback.mShouldReturnOwnActionMode = true;
ActionMode mode1 = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
ActionMode mode2 = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
assertTrue(mode1 instanceof MockActionMode);
assertTrue(((MockActionMode) mode1).mIsFinished);
assertNotNull(mode2);
}
use of android.view.ActionMode in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindowActionModeTest method testStartActionModePreservesPreviousModeOfDifferentType1.
public void testStartActionModePreservesPreviousModeOfDifferentType1() {
// Use custom callback to control the provided ActionMode.
mWindowCallback.mShouldReturnOwnActionMode = true;
ActionMode mode1 = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
ActionMode mode2 = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_PRIMARY);
assertTrue(mode1 instanceof MockActionMode);
assertFalse(((MockActionMode) mode1).mIsFinished);
assertNotNull(mode2);
}
use of android.view.ActionMode in project android_frameworks_base by DirtyUnicorns.
the class PhoneWindowActionModeTest method testCreatedModeIsNotStartedIfCreateReturnsFalse.
@UiThreadTest
public void testCreatedModeIsNotStartedIfCreateReturnsFalse() {
mWindowCallback.mShouldReturnOwnActionMode = false;
mActionModeCallback.mShouldCreateActionMode = false;
ActionMode mode = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
assertTrue(mActionModeCallback.mIsCreateActionModeCalled);
assertFalse(mWindowCallback.mIsActionModeStarted);
assertNull(mode);
}
Aggregations