From 1b576de112c925212192b88106352363aedc5320 Mon Sep 17 00:00:00 2001 From: Nolan Scobie Date: Mon, 9 Jan 2023 18:21:40 -0500 Subject: [PATCH] Tweak GraphicsStats#findRootPath to accept various valid locations This effectively makes the path change in Ibadb457d0c8f45ceca8153320ae5b896ae55bba2 optional instead of a requirement. Test: presubmits Bug: 257123741 Change-Id: I20e00bd78eb86298cd203ea96fd3d36e140611fa --- libs/hwui/tests/unit/GraphicsStatsServiceTests.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libs/hwui/tests/unit/GraphicsStatsServiceTests.cpp b/libs/hwui/tests/unit/GraphicsStatsServiceTests.cpp index 92fd8294a486a..c2d23e6d1101c 100644 --- a/libs/hwui/tests/unit/GraphicsStatsServiceTests.cpp +++ b/libs/hwui/tests/unit/GraphicsStatsServiceTests.cpp @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -49,8 +50,14 @@ std::string findRootPath() { // No code left untested TEST(GraphicsStats, findRootPath) { - std::string expected = "/data/local/tmp/nativetest/hwui_unit_tests/" ABI_STRING; - EXPECT_EQ(expected, findRootPath()); + // Different tools/infrastructure seem to push this to different locations. It shouldn't really + // matter where the binary is, so add new locations here as needed. This test still seems good + // as it's nice to understand the possibility space, and ensure findRootPath continues working + // as expected. + std::string acceptableLocations[] = {"/data/nativetest/hwui_unit_tests", + "/data/nativetest64/hwui_unit_tests", + "/data/local/tmp/nativetest/hwui_unit_tests/" ABI_STRING}; + EXPECT_THAT(acceptableLocations, ::testing::Contains(findRootPath())); } TEST(GraphicsStats, saveLoad) {