summaryrefslogtreecommitdiff
path: root/runtime/hidden_api_test.cc
diff options
context:
space:
mode:
author Artur Satayev <satayev@google.com> 2021-01-22 17:27:07 +0000
committer satayev <satayev@google.com> 2021-02-02 20:25:47 +0000
commitd8b153b7c2026f45db97a7fd5804957becc5cfdf (patch)
tree014e91484c13e2c44cfa1380f388c758b7c23c0c /runtime/hidden_api_test.cc
parentb1cf83748ce8165fe7e41ce6a57eb5529946a971 (diff)
Remove obsolete TestApiEnforcementPolicy.
Access to TestApis is now gated by @ChangeId ALLOW_TEST_API_ACCESS. Bug: 147113465 Test: presubmit Change-Id: I4c5e336069bce3bccfcde0bcd84b6c1f539635e9
Diffstat (limited to 'runtime/hidden_api_test.cc')
-rw-r--r--runtime/hidden_api_test.cc20
1 files changed, 0 insertions, 20 deletions
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index cfdba4552e..9c278fd720 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -216,7 +216,6 @@ TEST_F(HiddenApiTest, CheckTestApiEnforcement) {
static_cast<uint32_t>(hiddenapi::ApiList::MaxTargetR().GetMaxAllowedSdkVersion()) + 1);
// Default case where all TestApis are treated like non-TestApi.
- runtime_->SetTestApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kEnabled);
setChangeIdState(kAllowTestApiAccess, false);
ASSERT_EQ(
ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Sdk()), false);
@@ -234,25 +233,6 @@ TEST_F(HiddenApiTest, CheckTestApiEnforcement) {
ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Blocked()), true);
// A case where we want to allow access to TestApis.
- runtime_->SetTestApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kDisabled);
- setChangeIdState(kAllowTestApiAccess, false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Sdk()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Unsupported()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::MaxTargetR()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::MaxTargetQ()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::MaxTargetP()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::MaxTargetO()), false);
- ASSERT_EQ(
- ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Blocked()), false);
-
- // A second case where we want to allow access to TestApis.
- runtime_->SetTestApiEnforcementPolicy(hiddenapi::EnforcementPolicy::kEnabled);
setChangeIdState(kAllowTestApiAccess, true);
ASSERT_EQ(
ShouldDenyAccess(hiddenapi::ApiList::TestApi() | hiddenapi::ApiList::Sdk()), false);