• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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.cts.verifier;
18 
19 import com.android.compatibility.common.util.CddTest;
20 import com.android.interactive.annotations.Interactive;
21 import com.android.interactive.annotations.SupportMultiDisplayMode;
22 import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
23 
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26 
27 @RunWith(DeviceJUnit4ClassRunner.class)
28 public final class NetworkingTest extends CtsVerifierTest {
29 
30     @Interactive
31     @Test
32     // SingleDisplayMode
33     @CddTest(requirements = "7.4.3/C-7-1")
PresenceTest()34     public void PresenceTest() throws Exception {
35         requireFeatures("android.hardware.bluetooth_le");
36 
37         runTest(".presence.PresenceTestActivity");
38     }
39 
40     @Interactive
41     @Test
42     @SupportMultiDisplayMode
43     // MultiDisplayMode
BluetoothTest()44     public void BluetoothTest() throws Exception {
45         // Has a bunch of subtests but all require a second device so probably best to not split
46         requireFeatures("android.hardware.bluetooth");
47 
48         runTest(".bluetooth.BluetoothTestActivity");
49     }
50 
51     @Interactive
52     @Test
53     @SupportMultiDisplayMode
54     // MultiDisplayMode
ConnectivityBackgroundTest()55     public void ConnectivityBackgroundTest() throws Exception {
56         requireFeatures("android.hardware.wifi");
57 
58         runTest(".net.ConnectivityBackgroundTestActivity");
59     }
60 
61     @Interactive
62     @Test
63     @SupportMultiDisplayMode
64     // MultiDisplayMode
MultiNetworkConnectivityTest()65     public void MultiNetworkConnectivityTest() throws Exception {
66         requireFeatures("android.hardware.wifi:android.hardware.telephony");
67         excludeFeatures(
68                 "android.hardware.type.television",
69                 "android.software.leanback",
70                 "android.hardware.type.watch");
71 
72         runTest(".net.MultiNetworkConnectivityTestActivity");
73     }
74 
75     @Interactive
76     @Test
77     // SingleDisplayMode
P2pTest()78     public void P2pTest() throws Exception {
79         requireFeatures("android.hardware.wifi.direct");
80 
81         runTest(".p2p.P2pTestListActivity");
82     }
83 
84     @Interactive
85     @Test
86     // SingleDisplayMode
WifiTest()87     public void WifiTest() throws Exception {
88         // This test could potentially be split up into sub-tests for calling directly
89         requireFeatures("android.hardware.wifi");
90 
91         runTest(".wifi.TestListActivity");
92     }
93 
94     @Interactive
95     @Test
96     // SingleDisplayMode
WifiAwareTest()97     public void WifiAwareTest() throws Exception {
98         requireFeatures("android.hardware.wifi.aware");
99 
100         runTest(".wifiaware.TestListActivity");
101     }
102 }
103