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 package com.android.adservices.ui.settingsga;
17 
18 import static com.android.adservices.service.DebugFlagsConstants.KEY_CONSENT_NOTIFICATION_ACTIVITY_DEBUG_MODE;
19 import static com.android.adservices.service.FlagsConstants.KEY_DEBUG_UX;
20 import static com.android.adservices.service.FlagsConstants.KEY_ENABLE_AD_SERVICES_SYSTEM_API;
21 import static com.android.adservices.service.FlagsConstants.KEY_GA_UX_FEATURE_ENABLED;
22 import static com.android.adservices.service.FlagsConstants.KEY_RVC_POST_OTA_NOTIFICATION_ENABLED;
23 import static com.android.adservices.service.FlagsConstants.KEY_RVC_UX_ENABLED;
24 import static com.android.adservices.shared.testing.AndroidSdk.RVC;
25 
26 import androidx.test.ext.junit.runners.AndroidJUnit4;
27 
28 import com.android.adservices.common.AdServicesFlagsSetterRule;
29 import com.android.adservices.shared.testing.annotations.RequiresSdkRange;
30 import com.android.adservices.ui.util.AdServicesUiTestCase;
31 import com.android.adservices.ui.util.SettingsTestUtil;
32 
33 import org.junit.Rule;
34 import org.junit.Test;
35 import org.junit.runner.RunWith;
36 
37 @RunWith(AndroidJUnit4.class)
38 @RequiresSdkRange(atLeast = RVC, atMost = RVC)
39 public final class SettingsRvcUxSelectorUiAutomatorTest extends AdServicesUiTestCase {
40 
41     @Rule(order = 11)
42     public final AdServicesFlagsSetterRule flags =
43             AdServicesFlagsSetterRule.forGlobalKillSwitchDisabledTests()
44                     .setDebugFlag(KEY_CONSENT_NOTIFICATION_ACTIVITY_DEBUG_MODE, true)
45                     .setFlag(KEY_ENABLE_AD_SERVICES_SYSTEM_API, true)
46                     .setFlag(KEY_RVC_UX_ENABLED, true)
47                     .setFlag(KEY_RVC_POST_OTA_NOTIFICATION_ENABLED, true)
48                     .setFlag(KEY_GA_UX_FEATURE_ENABLED, true)
49                     .setFlag(KEY_DEBUG_UX, "RVC_UX")
50                     .setCompatModeFlags();
51 
52     @Test
settingsRemoveMainToggleAndMeasurementEntryTest()53     public void settingsRemoveMainToggleAndMeasurementEntryTest() throws Exception {
54         SettingsTestUtil.settingsRemoveMainToggleAndMeasurementEntryTestRvcUxUtil(mDevice);
55     }
56 
57     @Test
measurementDialogTest()58     public void measurementDialogTest() throws Exception {
59         SettingsTestUtil.measurementDialogTestUtil(mDevice);
60     }
61 
62     @Test
measurementToggleTest()63     public void measurementToggleTest() throws Exception {
64         SettingsTestUtil.measurementToggleTestUtil(mDevice);
65     }
66 
67     @Test
measurementSubtitleTest()68     public void measurementSubtitleTest() throws Exception {
69         SettingsTestUtil.measurementSubtitleTestUtil(mDevice);
70     }
71 
72     @Test
measurementToggleDialogTest()73     public void measurementToggleDialogTest() throws Exception {
74         SettingsTestUtil.measurementToggleDialogTestUtil(mDevice);
75     }
76 }
77