blob: 301099667eea5c9c10814a28fa743e8dda8f72e4 [file] [log] [blame]
Lucas Dupincea7dee2018-10-16 12:43:37 -07001package com.android.systemui.statusbar.phone
2
Brett Chabot84151d92019-02-27 15:37:59 -08003import androidx.test.filters.SmallTest
Lucas Dupincea7dee2018-10-16 12:43:37 -07004import android.testing.AndroidTestingRunner
5import android.testing.TestableLooper
6import android.view.LayoutInflater
7
8import com.android.systemui.R
9import com.android.systemui.SysuiTestCase
10import com.android.systemui.statusbar.KeyguardIndicationController
11
12import org.junit.Before
13import org.junit.Test
14import org.junit.runner.RunWith
15import org.mockito.Mock
16import org.mockito.MockitoAnnotations
17
18@SmallTest
19@RunWith(AndroidTestingRunner::class)
20@TestableLooper.RunWithLooper
21class KeyguardBottomAreaTest : SysuiTestCase() {
22
23 @Mock
24 private lateinit var mStatusBar: StatusBar
25 @Mock
26 private lateinit var mKeyguardIndicationController: KeyguardIndicationController
27 private lateinit var mKeyguardBottomArea: KeyguardBottomAreaView
28
29 @Before
30 fun setup() {
31 MockitoAnnotations.initMocks(this)
32 mKeyguardBottomArea = LayoutInflater.from(mContext).inflate(
33 R.layout.keyguard_bottom_area, null, false) as KeyguardBottomAreaView
34 mKeyguardBottomArea.setStatusBar(mStatusBar)
35 mKeyguardBottomArea.setKeyguardIndicationController(mKeyguardIndicationController)
36 }
37
38 @Test
39 fun initFrom_doesntCrash() {
40 val other = LayoutInflater.from(mContext).inflate(
41 R.layout.keyguard_bottom_area, null, false) as KeyguardBottomAreaView
42
43 other.initFrom(mKeyguardBottomArea)
44 other.launchVoiceAssist()
45 other.onLongClick(null)
46 }
47}