1 package org.robolectric.shadows; 2 3 import static org.robolectric.Shadows.shadowOf; 4 import static org.robolectric.shadow.api.Shadow.directlyOn; 5 6 import android.widget.ListPopupWindow; 7 import org.robolectric.RuntimeEnvironment; 8 import org.robolectric.annotation.Implementation; 9 import org.robolectric.annotation.Implements; 10 import org.robolectric.annotation.RealObject; 11 12 @Implements(ListPopupWindow.class) 13 public class ShadowListPopupWindow { 14 15 @RealObject 16 private ListPopupWindow realListPopupWindow; 17 18 @Implementation 19 public void show() { 20 shadowOf(RuntimeEnvironment.application).setLatestListPopupWindow(realListPopupWindow); 21 directlyOn(realListPopupWindow, ListPopupWindow.class).show(); 22 } 23 24 public static ListPopupWindow getLatestListPopupWindow() { 25 return shadowOf(RuntimeEnvironment.application).getLatestListPopupWindow(); 26 } 27 } 28