summaryrefslogtreecommitdiff
path: root/runtime/hidden_api_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-03-07 15:19:18 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2021-03-08 13:40:18 +0000
commit987a8eaa3b34dc4be71ee15e3ec56cc16ec8e5d3 (patch)
tree3d5990147790e1226be6409757234bb730d3d59c /runtime/hidden_api_test.cc
parent81b1d78b3422e72ecbe0092f99dbf7b9ecccc5ec (diff)
Create directory before running tests.
Fixes current flakes where there is a race between tests on when directories get created. Test: hidden_api_test Change-Id: I25301bf73bae76d5622e97ab231224cf5b329918
Diffstat (limited to 'runtime/hidden_api_test.cc')
-rw-r--r--runtime/hidden_api_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index 5e5f146f3f..7cec10c173 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -656,6 +656,7 @@ TEST_F(HiddenApiTest, DexDomain_SystemFrameworkDir) {
TEST_F(HiddenApiTest, DexDomain_SystemExtFrameworkDir) {
// Load file from a system_ext/framework directory and check that it is flagged as a framework dex.
+ std::filesystem::create_directory(android_system_ext_ + "/framework");
std::string system_ext_framework_location_path = android_system_ext_ + "/framework/foo.jar";
ASSERT_TRUE(LocationIsOnSystemExtFramework(system_ext_framework_location_path.c_str()));
TestLocation(system_ext_framework_location_path, hiddenapi::Domain::kPlatform);
@@ -698,6 +699,7 @@ TEST_F(HiddenApiTest, DexDomain_SystemExtDir_MultiDex) {
TEST_F(HiddenApiTest, DexDomain_SystemSystemExtDir_MultiDex) {
// Load multidex file from a system/system_ext, non-framework directory and check that it is not
// flagged as framework.
+ std::filesystem::create_directory(GetAndroidRoot() + "/system_ext");
std::string system_ext_multi_location_path =
GetAndroidRoot() + "/system_ext/multifoo.jar";
ASSERT_FALSE(LocationIsOnSystemExtFramework(system_ext_multi_location_path.c_str()));
@@ -707,6 +709,7 @@ TEST_F(HiddenApiTest, DexDomain_SystemSystemExtDir_MultiDex) {
TEST_F(HiddenApiTest, DexDomain_SystemFrameworkDir_MultiDex) {
// Load multidex file from a system/framework directory and check that it is flagged as a
// framework dex.
+ std::filesystem::create_directory(GetAndroidRoot() + "/framework");
std::string system_framework_multi_location_path = GetAndroidRoot() + "/framework/multifoo.jar";
ASSERT_TRUE(LocationIsOnSystemFramework(system_framework_multi_location_path.c_str()));
TestLocation(system_framework_multi_location_path, hiddenapi::Domain::kPlatform);
@@ -715,6 +718,7 @@ TEST_F(HiddenApiTest, DexDomain_SystemFrameworkDir_MultiDex) {
TEST_F(HiddenApiTest, DexDomain_SystemExtFrameworkDir_MultiDex) {
// Load multidex file from a system_ext/framework directory and check that it is flagged as a
// framework dex.
+ std::filesystem::create_directory(android_system_ext_ + "/framework");
std::string system_ext_framework_multi_location_path =
android_system_ext_ + "/framework/multifoo.jar";
ASSERT_TRUE(LocationIsOnSystemExtFramework(system_ext_framework_multi_location_path.c_str()));