diff options
author | hanlixy <hanlixy@google.com> | 2022-09-07 17:44:35 +0000 |
---|---|---|
committer | hanlixy <hanlixy@google.com> | 2022-09-07 17:47:54 +0000 |
commit | 44f7fcbf9458c0e7ca82b359ac4b9c857f0d21fa (patch) | |
tree | 20658ae90961528f1db5e462652949c20440106a /adservices/tests/cts/endtoends/permissions/notallowed | |
parent | f85e37582603f44fc03022d2e1eb06929c05665b (diff) | |
download | AdServices-44f7fcbf9458c0e7ca82b359ac4b9c857f0d21fa.tar.gz |
Grant Consent and enable VERBOSE logging level.
Also increase rate limit for OptOutTest.
Bug: 245339522
Test: atest
Change-Id: I2923697f8fabe0eae6970dde912d786c374088b8
Diffstat (limited to 'adservices/tests/cts/endtoends/permissions/notallowed')
-rw-r--r-- | adservices/tests/cts/endtoends/permissions/notallowed/src/com/android/adservices/tests/permissions/NotInAllowListTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/adservices/tests/cts/endtoends/permissions/notallowed/src/com/android/adservices/tests/permissions/NotInAllowListTest.java b/adservices/tests/cts/endtoends/permissions/notallowed/src/com/android/adservices/tests/permissions/NotInAllowListTest.java index d3fb434230..48ade8a6e1 100644 --- a/adservices/tests/cts/endtoends/permissions/notallowed/src/com/android/adservices/tests/permissions/NotInAllowListTest.java +++ b/adservices/tests/cts/endtoends/permissions/notallowed/src/com/android/adservices/tests/permissions/NotInAllowListTest.java @@ -25,6 +25,10 @@ import android.content.Context; import androidx.test.core.app.ApplicationProvider; +import com.android.compatibility.common.util.ShellUtils; + +import org.junit.After; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -42,6 +46,17 @@ public class NotInAllowListTest { "java.lang.SecurityException: Caller is not authorized to call this API. " + "Caller is not allowed."; + @Before + public void setup() { + overrideConsentManagerDebugMode(true); + overridingAdservicesLoggingLevel("VERBOSE"); + } + + @After + public void teardown() { + overrideConsentManagerDebugMode(false); + } + @Test public void testNotInAllowList() { AdvertisingTopicsClient advertisingTopicsClient1 = @@ -56,4 +71,14 @@ public class NotInAllowListTest { ExecutionException.class, () -> advertisingTopicsClient1.getTopics().get()); assertThat(exception.getMessage()).isEqualTo(CALLER_NOT_ALLOWED); } + + private void overridingAdservicesLoggingLevel(String loggingLevel) { + ShellUtils.runShellCommand("setprop log.tag.adservices %s", loggingLevel); + } + + // Override the Consent Manager behaviour - Consent Given + private void overrideConsentManagerDebugMode(boolean isGiven) { + ShellUtils.runShellCommand( + "setprop debug.adservices.consent_manager_debug_mode " + isGiven); + } } |