diff options
author | Steve Block <steveblock@google.com> | 2011-05-20 17:26:47 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 18:54:14 +0100 |
commit | 9eed25e2576403a91826312381f4507e8c8171c2 (patch) | |
tree | d15e1c88228019d17435f20d7d7b4e1edceb3d4c /tests/DumpRenderTree2 | |
parent | 183c3c9ca20f55703f31e3610bca72682f6355db (diff) | |
download | frameworks_base-9eed25e2576403a91826312381f4507e8c8171c2.zip frameworks_base-9eed25e2576403a91826312381f4507e8c8171c2.tar.gz frameworks_base-9eed25e2576403a91826312381f4507e8c8171c2.tar.bz2 |
In DRT2, correctly handle the case of zero tests
Bug: 3291382
Change-Id: I8cde1d8d78a57407c585b02ca8ba3f3f893a609b
Diffstat (limited to 'tests/DumpRenderTree2')
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java | 14 | ||||
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java | 6 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java index d9f5dd4..f59da37 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java @@ -398,6 +398,11 @@ public class LayoutTestsExecutor extends Activity { } private void startTests() { + // This is called when the tests are started and after each crash. + // We only send the reset message in the former case. + if (mCurrentTestIndex <= 0) { + sendResetMessage(); + } if (mCurrentTestIndex == 0) { sendFirstTestMessage(); } @@ -405,6 +410,15 @@ public class LayoutTestsExecutor extends Activity { runNextTest(); } + private void sendResetMessage() { + try { + Message serviceMsg = Message.obtain(null, ManagerService.MSG_RESET); + mManagerServiceMessenger.send(serviceMsg); + } catch (RemoteException e) { + Log.e(LOG_TAG, "Error sending message to manager service:", e); + } + } + private void sendFirstTestMessage() { try { Message serviceMsg = Message.obtain(null, ManagerService.MSG_FIRST_TEST); diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java index e4df62d..4783cc7 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java @@ -66,6 +66,7 @@ public class ManagerService extends Service { static final int MSG_ALL_TESTS_FINISHED = 1; static final int MSG_FIRST_TEST = 2; static final int MSG_CURRENT_TEST_CRASHED = 3; + static final int MSG_RESET = 4; /** * This handler is purely for IPC. It is used to create mMessenger @@ -75,8 +76,11 @@ public class ManagerService extends Service { @Override public void handleMessage(Message msg) { switch (msg.what) { - case MSG_FIRST_TEST: + case MSG_RESET: mSummarizer.reset(); + break; + + case MSG_FIRST_TEST: Bundle bundle = msg.getData(); ensureNextTestSetup(bundle.getString("firstTest"), bundle.getInt("index")); break; |