Lucas Dupin | 6865b71 | 2017-09-11 12:28:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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.systemui.statusbar.phone; |
| 18 | |
| 19 | import static org.mockito.Mockito.mock; |
| 20 | |
| 21 | import android.content.Context; |
| 22 | import android.support.test.filters.SmallTest; |
| 23 | import android.support.test.runner.AndroidJUnit4; |
| 24 | import android.test.UiThreadTest; |
| 25 | import android.view.ContextThemeWrapper; |
| 26 | import android.view.ViewGroup; |
| 27 | import android.widget.FrameLayout; |
| 28 | |
| 29 | import com.android.internal.widget.LockPatternUtils; |
| 30 | import com.android.keyguard.ViewMediatorCallback; |
| 31 | import com.android.systemui.R; |
| 32 | import com.android.systemui.SysuiTestCase; |
| 33 | import com.android.systemui.keyguard.DismissCallbackRegistry; |
| 34 | |
| 35 | import org.junit.Test; |
| 36 | import org.junit.runner.RunWith; |
| 37 | |
| 38 | @SmallTest |
| 39 | @RunWith(AndroidJUnit4.class) |
| 40 | public class KeyguardBouncerTest extends SysuiTestCase { |
| 41 | |
| 42 | @UiThreadTest |
| 43 | @Test |
| 44 | public void inflateDetached() { |
| 45 | final ViewGroup container = new FrameLayout(getContext()); |
| 46 | final KeyguardBouncer bouncer = new KeyguardBouncer(getContext(), |
| 47 | mock(ViewMediatorCallback.class), mock(LockPatternUtils.class), container, mock( |
| 48 | DismissCallbackRegistry.class)); |
| 49 | |
| 50 | // Detached bouncer should still be able to be inflated |
| 51 | bouncer.inflateView(); |
| 52 | } |
| 53 | |
| 54 | } |