OSDN Git Service

Fix failing ActionBarContainerTest#testFloatingActionModesAreBubbledUp
authorClara Bayarri <clarabayarri@google.com>
Mon, 5 Jun 2017 18:41:18 +0000 (19:41 +0100)
committerClara Bayarri <clarabayarri@google.com>
Mon, 5 Jun 2017 18:41:18 +0000 (19:41 +0100)
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

core/tests/coretests/src/com/android/internal/widget/ActionBarContainerTest.java

index 1471796..912b7ec 100644 (file)
@@ -60,11 +60,9 @@ public class ActionBarContainerTest extends AndroidTestCase {
         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);
     }