diff options
author | 2022-09-23 13:14:18 +0100 | |
---|---|---|
committer | 2022-10-05 14:43:59 +0000 | |
commit | ab3f419d42638dd0f51a202ef36ad0dc80ad8674 (patch) | |
tree | 6f328f5b9fffa1190bc6a3e7c1d0facdabc126a0 /artd/path_utils_test.cc | |
parent | 624f9159609a5b34bbb2c71aed24740e92d62afe (diff) |
Support profile merging.
Bug: 248318911
Test: m test-art-host-gtest-art_artd_tests
Test: atest ArtServiceTests
Ignore-AOSP-First: ART Services.
Change-Id: I0a6cb02ae31593f68648500e838882236881d349
Diffstat (limited to 'artd/path_utils_test.cc')
-rw-r--r-- | artd/path_utils_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/artd/path_utils_test.cc b/artd/path_utils_test.cc index 29a9cb875b..8188000c4e 100644 --- a/artd/path_utils_test.cc +++ b/artd/path_utils_test.cc @@ -33,6 +33,7 @@ using ::android::base::testing::HasError; using ::android::base::testing::HasValue; using ::android::base::testing::WithMessage; +using CurProfilePath = ProfilePath::CurProfilePath; using PrebuiltProfilePath = ProfilePath::PrebuiltProfilePath; using RefProfilePath = ProfilePath::RefProfilePath; using TmpRefProfilePath = ProfilePath::TmpRefProfilePath; @@ -186,6 +187,12 @@ TEST_F(PathUtilsTest, BuildPrebuiltProfilePath) { HasValue("/a/b.apk.prof")); } +TEST_F(PathUtilsTest, BuildCurProfilePath) { + EXPECT_THAT(BuildCurProfilePath(CurProfilePath{ + .userId = 1, .packageName = "com.android.foo", .profileName = "primary"}), + HasValue(android_data_ + "/misc/profiles/cur/1/com.android.foo/primary.prof")); +} + TEST_F(PathUtilsTest, BuildDexMetadataPath) { EXPECT_THAT(BuildDexMetadataPath(DexMetadataPath{.dexPath = "/a/b.apk"}), HasValue("/a/b.dm")); } @@ -207,6 +214,9 @@ TEST_F(PathUtilsTest, BuildProfilePath) { HasValue(android_data_ + "/misc/profiles/ref/com.android.foo/primary.prof.12345.tmp")); EXPECT_THAT(BuildProfileOrDmPath(PrebuiltProfilePath{.dexPath = "/a/b.apk"}), HasValue("/a/b.apk.prof")); + EXPECT_THAT(BuildProfileOrDmPath(CurProfilePath{ + .userId = 1, .packageName = "com.android.foo", .profileName = "primary"}), + HasValue(android_data_ + "/misc/profiles/cur/1/com.android.foo/primary.prof")); EXPECT_THAT(BuildProfileOrDmPath(DexMetadataPath{.dexPath = "/a/b.apk"}), HasValue("/a/b.dm")); } |