コード例 #1
0
 @Test
 public void isAtLeastMarshmallow() throws Exception {
   ReflectionHelpers.setStaticField(Build.VERSION.class, SDK_INT_FIELD, Build.VERSION_CODES.M);
   Sdk sdk = new SdkImpl();
   assertTrue(sdk.isAtLeastLollipopMR1());
   assertTrue(sdk.isAtLeastMarshmallow());
   assertFalse(sdk.isAtLeastCurrentDevelopmentVersion());
 }
コード例 #2
0
 @Test
 public void isAtLeastKitKat() throws Exception {
   ReflectionHelpers.setStaticField(
       Build.VERSION.class, SDK_INT_FIELD, Build.VERSION_CODES.KITKAT);
   Sdk sdk = new SdkImpl();
   assertTrue(sdk.isAtLeastJellyBeanMR2());
   assertTrue(sdk.isAtLeastKitKat());
   assertFalse(sdk.isAtLeastLollipop());
 }
コード例 #3
0
 @Before
 public void setUp() {
   /* Make sure isVisibleOrLegacy doesn't return false due to legacy */
   ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 18);
   ShadowAccessibilityNodeInfo.resetObtainedInstances();
 }
コード例 #4
0
 public void __constructor__() {
   ReflectionHelpers.setStaticField(
       AccessibilityEvent.class, "CREATOR", ShadowAccessibilityEvent.CREATOR);
 }