Hyundo Moon | 5736a61 | 2019-11-19 15:08:32 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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.mediaroutertest; |
| 18 | |
| 19 | import static org.junit.Assert.assertNotNull; |
| 20 | |
| 21 | import android.content.Context; |
| 22 | import android.media.MediaRoute2Info; |
| 23 | import android.media.MediaRouter2; |
| 24 | import android.support.test.InstrumentationRegistry; |
| 25 | import android.support.test.filters.SmallTest; |
| 26 | import android.support.test.runner.AndroidJUnit4; |
| 27 | |
| 28 | import org.junit.After; |
| 29 | import org.junit.Before; |
| 30 | import org.junit.Test; |
| 31 | import org.junit.runner.RunWith; |
| 32 | |
| 33 | @RunWith(AndroidJUnit4.class) |
| 34 | @SmallTest |
| 35 | public class MediaRouter2Test { |
| 36 | Context mContext; |
| 37 | |
| 38 | @Before |
| 39 | public void setUp() throws Exception { |
| 40 | mContext = InstrumentationRegistry.getTargetContext(); |
| 41 | } |
| 42 | |
| 43 | @After |
| 44 | public void tearDown() throws Exception { |
| 45 | } |
| 46 | |
| 47 | @Test |
| 48 | public void testGetSelectedRoute_afterCreation() throws Exception { |
| 49 | MediaRouter2 router = MediaRouter2.getInstance(mContext); |
| 50 | MediaRoute2Info initiallySelectedRoute = router.getSelectedRoute(); |
| 51 | assertNotNull(initiallySelectedRoute); |
| 52 | } |
| 53 | } |