Code example for PopupWindow

Methods: dismissisShowing

0
 
    @Test 
    public void testDismiss() { 
      shadowOf(popupWindow).setShowing(true);
 
      assertTrue(popupWindow.isShowing());
 
      popupWindow.dismiss();
 
      assertFalse(popupWindow.isShowing());
    } 
 
    @SuppressWarnings("RedundantCast") //For some reason this is needed because of a compile error without it 
    @Test 
    public void testBackgroundDrawable() { 
      BitmapDrawable bitmapDrawable = new BitmapDrawable();
      popupWindow.setBackgroundDrawable(bitmapDrawable);
 
      assertThat((BitmapDrawable) popupWindow.getBackground()).isSameAs(bitmapDrawable);
    }