commit | 3c523040cb8758e959081482a2e4632ce11bd9ac | [log] [tgz] |
---|---|---|
author | vadimt <vadimt@google.com> | Fri Aug 09 10:40:20 2019 -0700 |
committer | android-build-merger <android-build-merger@google.com> | Fri Aug 09 10:40:20 2019 -0700 |
tree | 17bfee6374cdee8a4d3c7d66855fbf632f2f0441 | |
parent | 268e4ff95c03aa825b0f2ac3d39743a6e248b655 [diff] | |
parent | c1a2764a6e488bfdc9952fa9270b6a78309741cd [diff] |
Support for memory tests am: c1a2764a6e Change-Id: Ife853a32fa9e52f8993d25167af61dabc7fd64b8
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index bab454f..4fd0f88 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -112,6 +112,13 @@ } break; } + + case TestProtocol.REQUEST_ALLOCATED_MEMORY: { + final Runtime runtime = Runtime.getRuntime(); + response.putLong(TestProtocol.TEST_INFO_RESPONSE_FIELD, + runtime.totalMemory() - runtime.freeMemory()); + break; + } } return response; }
diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index cb8f811..f9f5dc4 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java
@@ -73,6 +73,7 @@ public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags"; public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin"; public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin"; + public static final String REQUEST_ALLOCATED_MEMORY = "allocated-memory"; public static boolean sDebugTracing = false; public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 6348c41..c012628 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -956,4 +956,9 @@ public void disableDebugTracing() { getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING); } + + public long getAllocatedMemory() { + return getTestInfo(TestProtocol.REQUEST_ALLOCATED_MEMORY). + getLong(TestProtocol.TEST_INFO_RESPONSE_FIELD); + } } \ No newline at end of file