diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2019-08-28 12:10:51 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2019-09-26 17:53:20 +0000 |
commit | 2e3942246d14a52e4ca2d421ae81b91416a90643 (patch) | |
tree | 3e4f3680510922a5b18413875324dd0a70fbc22d /libs/androidfw/tests | |
parent | 68e6b3af8876997126d741788fd64531a8f3c6fb (diff) |
Enable CTS verification of overlayable API
Allows retrieval of a string representation of overlayable resources
that can be compared during CTS testing to verify that the overlayable
resources on device match the expected overlayable API.
Bug: 135052616
Test: libandroidfw_tests
Test: atest OverlayHostTest
Change-Id: I613f28c202a0904a917577f932d072111c1aa7bd
Diffstat (limited to 'libs/androidfw/tests')
-rw-r--r-- | libs/androidfw/tests/AssetManager2_test.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/androidfw/tests/AssetManager2_test.cpp b/libs/androidfw/tests/AssetManager2_test.cpp index 40c8e46e4d84..15910241518d 100644 --- a/libs/androidfw/tests/AssetManager2_test.cpp +++ b/libs/androidfw/tests/AssetManager2_test.cpp @@ -707,7 +707,7 @@ TEST_F(AssetManager2Test, GetLastPathAfterDisablingReturnsEmpty) { EXPECT_EQ("", resultDisabled); } -TEST_F(AssetManager2Test, GetOverlayableMap) { +TEST_F(AssetManager2Test, GetOverlayablesToString) { ResTable_config desired_config; memset(&desired_config, 0, sizeof(desired_config)); @@ -721,6 +721,12 @@ TEST_F(AssetManager2Test, GetOverlayableMap) { ASSERT_EQ(2, map->size()); ASSERT_EQ(map->at("OverlayableResources1"), "overlay://theme"); ASSERT_EQ(map->at("OverlayableResources2"), "overlay://com.android.overlayable"); + + std::string api; + ASSERT_TRUE(assetmanager.GetOverlayablesToString("com.android.overlayable", &api)); + ASSERT_EQ(api.find("not_overlayable"), std::string::npos); + ASSERT_NE(api.find("resource='com.android.overlayable:string/overlayable2' overlayable='OverlayableResources1' actor='overlay://theme' policy='0x0000000a'\n"), + std::string::npos); } } // namespace android |