Skip to content
Snippets Groups Projects
Commit 41261d59 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Use @EnableFlags and @DisableFlags annotations instead of soon-to-be deprecated methods.

These tests are build with -Werror, so we need to migrate them.

Bug: 341129262
Change-Id: I0bd8d03f16f0fef1772826a24f663a7babe2bfcd
Flag: test_only
Test: presubmit
Merged-In: I7661dd73c3f9d0e44cabd928b96cf2affc9cae22
parent 3ff587dd
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@
package android.hardware.input
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.content.ContextWrapper
import android.graphics.drawable.Drawable
import android.platform.test.annotations.Presubmit
......@@ -54,16 +56,16 @@ class KeyboardLayoutPreviewTests {
}
@Test
@EnableFlags(Flags.FLAG_KEYBOARD_LAYOUT_PREVIEW_FLAG)
fun testKeyboardLayoutDrawable_hasCorrectDimensions() {
setFlagsRule.enableFlags(Flags.FLAG_KEYBOARD_LAYOUT_PREVIEW_FLAG)
val drawable = createDrawable()!!
assertEquals(WIDTH, drawable.intrinsicWidth)
assertEquals(HEIGHT, drawable.intrinsicHeight)
}
@Test
@DisableFlags(Flags.FLAG_KEYBOARD_LAYOUT_PREVIEW_FLAG)
fun testKeyboardLayoutDrawable_isNull_ifFlagOff() {
setFlagsRule.disableFlags(Flags.FLAG_KEYBOARD_LAYOUT_PREVIEW_FLAG)
assertNull(createDrawable())
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment