diff options
| author | Ben Murdoch <benm@google.com> | 2010-06-01 18:45:10 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2010-06-03 12:39:09 +0100 |
| commit | 9b815d080145f0bc8effc9e011090010ad51f203 (patch) | |
| tree | 8499934b8fd93502fae44ba5ef87b663fc6660b4 /tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java | |
| parent | 22449c1d3b37471558a43a0425800971ea37e377 (diff) | |
| download | frameworks_base-9b815d080145f0bc8effc9e011090010ad51f203.zip frameworks_base-9b815d080145f0bc8effc9e011090010ad51f203.tar.gz frameworks_base-9b815d080145f0bc8effc9e011090010ad51f203.tar.bz2 | |
DumpRenderTree changes
- Make the layout test counter work when you run tests through the GUI
- Use the progress bar in the applications title bar to display test progress
Change-Id: I3d4b778470e812b80b7a64297b3a64ba6f9d083c
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java')
| -rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java b/tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java index 82671eb..5ffe6b0 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/Menu.java @@ -51,29 +51,38 @@ public class Menu extends FileList { intent.setClass(this, TestShellActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra(TestShellActivity.TEST_URL, "file://" + filename); + intent.putExtra(TestShellActivity.TOTAL_TEST_COUNT, 1); + intent.putExtra(TestShellActivity.CURRENT_TEST_NUMBER, 1); startActivity(intent); } @Override void processDirectory(String path, boolean selection) { - generateTestList(path); + int testCount = generateTestList(path); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClass(this, TestShellActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra(TestShellActivity.UI_AUTO_TEST, LAYOUT_TESTS_LIST_FILE); + intent.putExtra(TestShellActivity.TOTAL_TEST_COUNT, testCount); + // TestShellActivity will process this intent once and increment the test index + // before running the first test, so pass 0 here to allow for that. + intent.putExtra(TestShellActivity.CURRENT_TEST_NUMBER, 0); startActivity(intent); } - private void generateTestList(String path) { + private int generateTestList(String path) { + int testCount = 0; try { File tests_list = new File(LAYOUT_TESTS_LIST_FILE); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tests_list, false)); - FsUtils.findLayoutTestsRecursively(bos, path, false); // Don't ignore results + testCount = FsUtils.writeLayoutTestListRecursively( + bos, path, false); // Don't ignore results bos.flush(); bos.close(); } catch (Exception e) { Log.e(LOGTAG, "Error when creating test list: " + e.getMessage()); } + return testCount; } } |
