Add profileable app to heapprofd CTS.
Change-Id: I496a9a03c332d78ee88851911905ef63569adcb7
diff --git a/test/cts/AndroidTest.xml b/test/cts/AndroidTest.xml
index a6deef2..d34d264 100644
--- a/test/cts/AndroidTest.xml
+++ b/test/cts/AndroidTest.xml
@@ -24,6 +24,7 @@
<option name="test-file-name" value="CtsPerfettoProducerApp.apk" />
<option name="test-file-name" value="CtsPerfettoDebuggableApp.apk" />
<option name="test-file-name" value="CtsPerfettoReleaseApp.apk" />
+ <option name="test-file-name" value="CtsPerfettoProfileableApp.apk" />
</target_preparer>
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="cleanup" value="true" />
diff --git a/test/cts/heapprofd_test_apps/Android.bp b/test/cts/heapprofd_test_apps/Android.bp
index e759410..bc2b323 100644
--- a/test/cts/heapprofd_test_apps/Android.bp
+++ b/test/cts/heapprofd_test_apps/Android.bp
@@ -51,3 +51,23 @@
"libnativehelper_compat_libc++",
],
}
+
+android_test_helper_app {
+ name: "CtsPerfettoProfileableApp",
+ // tag this module as a cts test artifact
+ test_suites: [
+ "cts",
+ "vts",
+ "general-tests",
+ ],
+
+ manifest: "AndroidManifest_profileable.xml",
+
+ compile_multilib: "both",
+ srcs: ["src/**/*.java"],
+ sdk_version: "current",
+ jni_libs: [
+ "libperfettocts_heapprofdtarget",
+ "libnativehelper_compat_libc++",
+ ],
+}
diff --git a/test/cts/heapprofd_test_apps/AndroidManifest_profileable.xml b/test/cts/heapprofd_test_apps/AndroidManifest_profileable.xml
new file mode 100755
index 0000000..99ceda2
--- /dev/null
+++ b/test/cts/heapprofd_test_apps/AndroidManifest_profileable.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.perfetto.cts.app.profileable">
+
+ <application>
+ <profileable android:shell="true"/>
+ <activity
+ android:name="android.perfetto.cts.app.MainActivity"
+ android:exported="false">
+ </activity>
+ <activity-alias
+ android:name="android.perfetto.cts.app.profileable.MainActivity"
+ android:targetActivity="android.perfetto.cts.app.MainActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity-alias>
+ </application>
+</manifest>
+
diff --git a/test/cts/heapprofd_test_cts.cc b/test/cts/heapprofd_test_cts.cc
index c2d37dd..b32972b 100644
--- a/test/cts/heapprofd_test_cts.cc
+++ b/test/cts/heapprofd_test_cts.cc
@@ -245,6 +245,20 @@
StopApp(app_name);
}
+TEST(HeapprofdCtsTest, ProfileableAppRuntime) {
+ std::string app_name = "android.perfetto.cts.app.profileable";
+ const auto& packets = ProfileRuntime(app_name);
+ AssertExpectedAllocationsPresent(packets);
+ StopApp(app_name);
+}
+
+TEST(HeapprofdCtsTest, ProfileableAppStartup) {
+ std::string app_name = "android.perfetto.cts.app.profileable";
+ const auto& packets = ProfileStartup(app_name);
+ AssertExpectedAllocationsPresent(packets);
+ StopApp(app_name);
+}
+
TEST(HeapprofdCtsTest, ReleaseAppRuntime) {
std::string app_name = "android.perfetto.cts.app.release";
const auto& packets = ProfileRuntime(app_name);