GpuStats: migrate to new statsd native puller api (part 3)
This change migrates the app atom puller over to the new api.
Bug: 148421389
Test: atest gpuservice_unittest
Test: statsd_testdrive 10054
Test: statsd_testdrive 10055
Change-Id: I629ea35e7205f469d168c5c7a58904d74b2e6308
diff --git a/services/gpuservice/tests/unittests/GpuStatsTest.cpp b/services/gpuservice/tests/unittests/GpuStatsTest.cpp
index 7e39f9e..37ebeae 100644
--- a/services/gpuservice/tests/unittests/GpuStatsTest.cpp
+++ b/services/gpuservice/tests/unittests/GpuStatsTest.cpp
@@ -286,5 +286,22 @@
EXPECT_FALSE(inputCommand(InputCommand::DUMP_APP).empty());
}
+TEST_F(GpuStatsTest, canPullAppAtom) {
+ TestableGpuStats testableGpuStats(mGpuStats.get());
+ mGpuStats->insertDriverStats(BUILTIN_DRIVER_PKG_NAME, BUILTIN_DRIVER_VER_NAME,
+ BUILTIN_DRIVER_VER_CODE, BUILTIN_DRIVER_BUILD_TIME, APP_PKG_NAME_1,
+ VULKAN_VERSION, GpuStatsInfo::Driver::GL, true,
+ DRIVER_LOADING_TIME_1);
+
+ EXPECT_FALSE(inputCommand(InputCommand::DUMP_GLOBAL).empty());
+ EXPECT_FALSE(inputCommand(InputCommand::DUMP_APP).empty());
+
+ EXPECT_TRUE(testableGpuStats.makePullAtomCallback(android::util::GPU_STATS_APP_INFO) ==
+ AStatsManager_PULL_SUCCESS);
+
+ EXPECT_FALSE(inputCommand(InputCommand::DUMP_GLOBAL).empty());
+ EXPECT_TRUE(inputCommand(InputCommand::DUMP_APP).empty());
+}
+
} // namespace
} // namespace android