• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.tv.util;
18 
19 import static com.google.common.truth.Truth.assertThat;
20 
21 import android.media.tv.TvInputInfo;
22 import android.media.tv.TvInputManager;
23 
24 import com.android.tv.common.flags.impl.DefaultLegacyFlags;
25 import com.android.tv.testing.constants.ConfigConstants;
26 
27 import org.junit.Test;
28 import org.junit.runner.RunWith;
29 import org.robolectric.RobolectricTestRunner;
30 import org.robolectric.RuntimeEnvironment;
31 import org.robolectric.annotation.Config;
32 
33 /**
34  * Tests for {@link TvInputManagerHelper}.
35  *
36  * <p>This test is named ...RoboTest because there is already a test named <code>
37  * TvInputManagerHelperTest</code>
38  */
39 @RunWith(RobolectricTestRunner.class)
40 @Config(sdk = ConfigConstants.SDK)
41 public class TvInputManagerHelperRoboTest {
42 
43     @Test
getInputState_null()44     public void getInputState_null() {
45         TvInputInfo tvinputInfo = null;
46         TvInputManagerHelper tvInputManagerHelper =
47                 new TvInputManagerHelper(
48                         RuntimeEnvironment.application, DefaultLegacyFlags.DEFAULT);
49         assertThat(TvInputManager.INPUT_STATE_DISCONNECTED)
50                 .isSameInstanceAs(tvInputManagerHelper.getInputState(tvinputInfo));
51     }
52 }
53