1This directory contains the CTS tests for the Perfetto library. 2 3# Background 4For information about what CTS is, please go to 5https://source.android.com/compatibility/cts/ where you will find information 6on the purpose of CTS and how to run these tests. 7 8# Test contents 9The single GTest target (CtsPerfettoTestCases) contains the following notable 10test suites: 11* PerfettoCtsTest - verifies that any Android app can operate as a perfetto 12 producer. 13* HeapprofdCtsTest - verifies that Android apps can be heap-profiled, and that 14 the manifest-based opt-in is respected. 15* The contents of perfetto/test/end\_to\_end\_integrationtest.cc. 16 17## PerfettoCtsTest 18The GTest suite is both the consumer of data as well as the driver the actual 19tests we wish to run. This target drives the tracing system by requesting 20tracing to start/stop and ensures the data it receives is correct. This mimics 21the role of real consumers acting as the driver for tracing on device. This 22suite is compiled and pushed to device and subsequently run using a shell 23account which gives us permissions to access the perfetto consumer socket. 24 25The mock producer is an Android app with a thin Java wrapping around the C++ 26library interfaced using JNI. The purpose of this target is to ensure that the 27TraceProto received from the consumer is valid and then push some fake data. 28This ensures that any arbitrary app can push data to the Perfetto socket which 29can then be decoded by the GTest consumer. 30 31## HeapprofdCtsTest 32The tests cover the intersection of profiling from-startup/at-runtime, and 33whether the target app is debuggable. The GTest binary handles the targets' 34lifetimes, acts as a profiling consumer, and asserts the contents of the 35resultant traces. 36