This test was failing because the returned action mode is null. This
is expected, as the calls bubble up the parent hierarchy and we are
testing on an unattached parent. We only wanted to test that it
bubbles up the parent when it is floating, and that is already
achieved in the test without checking what the actual returned mode
is.
Bug:
38339380
Test: bit FrameworksCoreTests:com.android.internal.widget.ActionBarContainerTest\#testFloatingActionModesAreBubbledUp
Change-Id: Ieeac4949d523bee993458ace5db2dd7f35d45496
TestViewGroup viewGroup = new TestViewGroup(mContext);
viewGroup.addView(mActionBarContainer);
- ActionMode mode = mActionBarContainer.startActionModeForChild(
- null, null, ActionMode.TYPE_FLOATING);
+ mActionBarContainer.startActionModeForChild(null, null, ActionMode.TYPE_FLOATING);
// Should bubble up.
- assertNotNull(mode);
assertTrue(viewGroup.isStartActionModeForChildTypedCalled);
}