• 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  * Complext filter clear group reboot test cases
28  *
29  * Reuses existing test cases from {@link android.dynamicmime.testapp.ComplexFilterTest}
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 ComplexFilterClearGroupRebootTestCases extends RebootTestCaseBase {
43 
44     @Test
testClearGroupWithoutIntersection()45     public void testClearGroupWithoutIntersection() throws DeviceNotAvailableException {
46         runTestWithReboot("ComplexFilterTest", "testClearGroupWithoutIntersection");
47     }
48 
49     @Test
testClearGroupWithIntersection()50     public void testClearGroupWithIntersection() throws DeviceNotAvailableException {
51         runTestWithReboot("ComplexFilterTest", "testClearGroupWithIntersection");
52     }
53 
54     @Test
testClearGroupContainsStaticType()55     public void testClearGroupContainsStaticType() throws DeviceNotAvailableException {
56         runTestWithReboot("ComplexFilterTest", "testClearGroupContainsStaticType");
57     }
58 
59     @Test
testClearGroupNotContainStaticType()60     public void testClearGroupNotContainStaticType() throws DeviceNotAvailableException {
61         runTestWithReboot("ComplexFilterTest", "testClearGroupNotContainStaticType");
62     }
63 }
64