From ff539516b33b5f01d33ae4917d6469dfb162c74a Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Wed, 26 Sep 2018 16:39:29 -0700 Subject: Notify that there is a test run going on Bug: 116749503 Test: atest native-processes-memory-test, observer test ouput indicates 1 test passed Change-Id: Ibac5f47a7a295c53f35e9043bb3e2aa4d635e820 --- .../android/tests/nativeprocesses/NativeProcessesMemoryTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/NativeProcessesMemoryTest') diff --git a/tests/NativeProcessesMemoryTest/src/com/android/tests/nativeprocesses/NativeProcessesMemoryTest.java b/tests/NativeProcessesMemoryTest/src/com/android/tests/nativeprocesses/NativeProcessesMemoryTest.java index ae011a0316aa..c86f06eb88e4 100644 --- a/tests/NativeProcessesMemoryTest/src/com/android/tests/nativeprocesses/NativeProcessesMemoryTest.java +++ b/tests/NativeProcessesMemoryTest/src/com/android/tests/nativeprocesses/NativeProcessesMemoryTest.java @@ -21,6 +21,7 @@ import com.android.tradefed.log.LogUtil.CLog; import com.android.tradefed.result.ByteArrayInputStreamSource; import com.android.tradefed.result.ITestInvocationListener; import com.android.tradefed.result.LogDataType; +import com.android.tradefed.result.TestDescription; import com.android.tradefed.testtype.IDeviceTest; import com.android.tradefed.testtype.IRemoteTest; @@ -84,7 +85,10 @@ public class NativeProcessesMemoryTest implements IDeviceTest, IRemoteTest { // showmap requires root, we enable it here for the rest of the test mTestDevice.enableAdbRoot(); - listener.testRunStarted(RUN_NAME, 0 /* testCount */); + listener.testRunStarted(RUN_NAME, 1 /* testCount */); + + TestDescription testDescription = new TestDescription(getClass().getName(), "run"); + listener.testStarted(testDescription); // process name -> list of pids with that name Map> nativeProcesses = collectNativeProcesses(); @@ -94,7 +98,8 @@ public class NativeProcessesMemoryTest implements IDeviceTest, IRemoteTest { mNativeProcessToMemory.put( NUM_NATIVE_PROCESSES_KEY, Integer.toString(nativeProcesses.size())); - listener.testRunEnded(0, mNativeProcessToMemory); + listener.testEnded(testDescription, mNativeProcessToMemory); + listener.testRunEnded(0, new HashMap()); } /** Samples memory of all processes and logs the memory use. */ -- cgit v1.2.3-59-g8ed1b