• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
<lambda>null2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.input.screenshot
18 
19 import android.content.Context
20 import org.junit.Rule
21 import org.junit.Test
22 import org.junit.runner.RunWith
23 import platform.test.runner.parameterized.ParameterizedAndroidJunit4
24 import platform.test.runner.parameterized.Parameters
25 import platform.test.screenshot.DeviceEmulationSpec
26 
27 /** A screenshot test for Keyboard layout preview for Iso physical layout. */
28 @RunWith(ParameterizedAndroidJunit4::class)
29 class KeyboardLayoutPreviewIsoScreenshotTest(emulationSpec: DeviceEmulationSpec) {
30     companion object {
31         @Parameters(name = "{0}")
32         @JvmStatic
33         fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
34     }
35 
36     @get:Rule
37     val screenshotRule = InputScreenshotTestRule(
38             emulationSpec,
39             "frameworks/base/tests/InputScreenshotTest/assets"
40     )
41 
42     @Test
43     fun test() {
44         screenshotRule.screenshotTest("layout-preview") {
45             context: Context -> LayoutPreview.createLayoutPreview(context, null)
46         }
47     }
48 }
49