• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 android.dynamicmime.cts;
18 
19 import com.android.compatibility.common.util.ApiTest;
20 import com.android.tradefed.device.DeviceNotAvailableException;
21 import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
22 
23 import org.junit.Test;
24 import org.junit.runner.RunWith;
25 
26 /**
27  * Single app reboot test cases
28  *
29  * Reuses existing test cases from {@link android.dynamicmime.testapp.SingleAppTest}
30  * by "inserting" device reboot between setup part (MIME group commands) and verification part
31  * (MIME group assertions) in each test case
32  *
33  * @see android.dynamicmime.testapp.reboot.PreRebootSingleAppTest
34  * @see android.dynamicmime.testapp.reboot.PostRebootSingleAppTest
35  * @see #runTestWithReboot(String, String)
36  */
37 @ApiTest(apis = {
38         "android.content.pm.PackageManager#getMimeGroup",
39         "android.content.pm.PackageManager#setMimeGroup"
40 })
41 @RunWith(DeviceJUnit4ClassRunner.class)
42 public class SingleAppRebootTestCases extends RebootTestCaseBase {
43 
44     @Test
testAddSimilarTypes()45     public void testAddSimilarTypes() throws DeviceNotAvailableException {
46         runTestWithReboot("SingleAppTest", "testAddSimilarTypes");
47     }
48 
49     @Test
testAddDifferentTypes()50     public void testAddDifferentTypes() throws DeviceNotAvailableException {
51         runTestWithReboot("SingleAppTest", "testAddDifferentTypes");
52     }
53 
54     @Test
testResetWithoutIntersection()55     public void testResetWithoutIntersection() throws DeviceNotAvailableException {
56         runTestWithReboot("SingleAppTest", "testResetWithoutIntersection");
57     }
58 
59     @Test
testResetWithIntersection()60     public void testResetWithIntersection() throws DeviceNotAvailableException {
61         runTestWithReboot("SingleAppTest", "testResetWithIntersection");
62     }
63 
64     @Test
testClear()65     public void testClear() throws DeviceNotAvailableException {
66         runTestWithReboot("SingleAppTest", "testClear");
67     }
68 }
69