use of android.view.ActionMode in project android_frameworks_base by crdroidandroid.
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 crdroidandroid.
the class PhoneWindowActionModeTest method testWindowCallbackModesLifecycleIsNotHandled.
public void testWindowCallbackModesLifecycleIsNotHandled() {
mWindowCallback.mShouldReturnOwnActionMode = true;
ActionMode mode = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_PRIMARY);
assertNotNull(mode);
assertEquals(mWindowCallback.mLastCreatedActionMode, mode);
assertFalse(mActionModeCallback.mIsCreateActionModeCalled);
assertTrue(mWindowCallback.mIsActionModeStarted);
}
use of android.view.ActionMode in project android_frameworks_base by crdroidandroid.
the class PhoneWindowActionModeTest method testStartActionModeWithCallback.
public void testStartActionModeWithCallback() {
mWindowCallback.mShouldReturnOwnActionMode = true;
ActionMode mode = mPhoneWindow.getDecorView().startActionMode(mActionModeCallback, ActionMode.TYPE_FLOATING);
assertEquals(mWindowCallback.mLastCreatedActionMode, mode);
}
use of android.view.ActionMode in project android_frameworks_base by crdroidandroid.
the class ActionBarContainerTest method testPrimaryActionModesAreStopped.
public void testPrimaryActionModesAreStopped() {
TestViewGroup viewGroup = new TestViewGroup(mContext);
viewGroup.addView(mActionBarContainer);
ActionMode mode = mActionBarContainer.startActionModeForChild(null, null, ActionMode.TYPE_PRIMARY);
assertNull(mode);
// Should not bubble up.
assertFalse(viewGroup.isStartActionModeForChildTypedCalled);
assertFalse(viewGroup.isStartActionModeForChildTypelessCalled);
mode = mActionBarContainer.startActionModeForChild(null, null);
assertNull(mode);
// Should not bubble up.
assertFalse(viewGroup.isStartActionModeForChildTypedCalled);
assertFalse(viewGroup.isStartActionModeForChildTypelessCalled);
}
use of android.view.ActionMode in project android_frameworks_base by crdroidandroid.
the class ActionBarContainerTest method testFloatingActionModesAreBubbledUp.
public void testFloatingActionModesAreBubbledUp() {
TestViewGroup viewGroup = new TestViewGroup(mContext);
viewGroup.addView(mActionBarContainer);
ActionMode mode = mActionBarContainer.startActionModeForChild(null, null, ActionMode.TYPE_FLOATING);
// Should bubble up.
assertNotNull(mode);
assertTrue(viewGroup.isStartActionModeForChildTypedCalled);
}
Aggregations