car/src/androidTest/java/androidx/car/widget/ActionBarTest.java
@Test
    public void testCustomExpandCollapseView() {
        View customExpandCollapse = new ToggleButton(mActivity);
        customExpandCollapse.setContentDescription(mActivity.getString(
                R.string.action_bar_expand_collapse_button));
        setExpandCollapseCustomView(customExpandCollapse);
        setUpActionBarItems(NUM_COLS + 1);

        onView(withContentDescription(R.string.action_bar_expand_collapse_button))
                .check((view, noViewFoundException) -> {
                    Preconditions.checkNotNull(view);
                    assertEquals(customExpandCollapse, mActionBar.getViewAt(BOTTOM_ROW_IDX,
                            NUM_COLS - 1));
                });
    }
/**
     * Tests setting custom expand/collapse views.
     */
Tests setting custom expand/collapse views.
Tests setting custom expand / collapse views .
@Test
    public void testCustomExpandCollapseView() {
        View customExpandCollapse = new ToggleButton(mActivity);
        customExpandCollapse.setContentDescription(mActivity.getString(
                R.string.action_bar_expand_collapse_button));
        setExpandCollapseCustomView(customExpandCollapse);
        setUpActionBarItems(NUM_COLS + 1);
        onView(withContentDescription(R.string.action_bar_expand_collapse_button))
                .check((view, noViewFoundException) -> {
                    Preconditions.checkNotNull(view);
                    assertEquals(customExpandCollapse, mActionBar.getViewAt(BOTTOM_ROW_IDX,
                            NUM_COLS - 1));
                });
    }
@ Test public void testCustomExpandCollapseView ( ) { View customExpandCollapse = new ToggleButton ( mActivity ) ; customExpandCollapse . setContentDescription ( mActivity . getString ( R . string . action_bar_expand_collapse_button ) ) ; setExpandCollapseCustomView ( customExpandCollapse ) ; setUpActionBarItems ( NUM_COLS + 1 ) ; onView ( withContentDescription ( R . string . action_bar_expand_collapse_button ) ) . check ( ( view , noViewFoundException ) -> { Preconditions . checkNotNull ( view ) ; assertEquals ( customExpandCollapse , mActionBar . getViewAt ( BOTTOM_ROW_IDX , NUM_COLS - 1 ) ) ; } ) ; }
Tests setting custom expand/collapse views.
Tests setting custom expand / collapse views .