diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-18 15:18:17 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-18 15:18:17 -0700 |
commit | 1058c63b262c838a57301fde59b04c9fa0ee1fdc (patch) | |
tree | 518e62f25a80c810785663be39b5e30b8f4bb46d /tests | |
parent | af9992802992aaccfe1fb5893448939f215dd607 (diff) | |
parent | 2a197b128a2317eec6efaa0a21e529cdf534c6f2 (diff) | |
download | frameworks_base-1058c63b262c838a57301fde59b04c9fa0ee1fdc.zip frameworks_base-1058c63b262c838a57301fde59b04c9fa0ee1fdc.tar.gz frameworks_base-1058c63b262c838a57301fde59b04c9fa0ee1fdc.tar.bz2 |
Merge change 1909 into donut
* changes:
Fixed IndexOutofBoundException, improved how memory information is captured (run GC first)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java | 9 | ||||
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java | 12 |
2 files changed, 18 insertions, 3 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java index caef861..f169a26 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java @@ -223,7 +223,10 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh } private String getExpectedResultFile(String test) { - String shortName = test.substring(0, test.lastIndexOf('.')); + int pos = test.lastIndexOf('.'); + if(pos == -1) + return null; + String shortName = test.substring(0, pos); return shortName + "-expected.txt"; } @@ -303,6 +306,10 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh }); String resultFile = getResultFile(test); + if(resultFile == null) { + //simply ignore this test + return; + } if (mRebaselineResults) { String expectedResultFile = getExpectedResultFile(test); File f = new File(expectedResultFile); diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java index 81cf3a8..c792e8e 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java @@ -69,11 +69,14 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel TestShellActivity activity = (TestShellActivity) getActivity(); + Log.v(LOGTAG, "About to run tests, calling gc first..."); + Runtime.getRuntime().runFinalization(); + Runtime.getRuntime().gc(); + Runtime.getRuntime().gc(); + // Run tests runTestAndWaitUntilDone(activity, runner.mTestPath, runner.mTimeoutInMillis); - // TODO(fqian): let am instrumentation pass in the command line, currently - // am instrument does not allow spaces in the command. dumpMemoryInfo(); // Kill activity @@ -82,6 +85,11 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel private void dumpMemoryInfo() { try { + Log.v(LOGTAG, "About to dump meminfo, calling gc first..."); + Runtime.getRuntime().runFinalization(); + Runtime.getRuntime().gc(); + Runtime.getRuntime().gc(); + Log.v(LOGTAG, "Dumping memory information."); FileOutputStream out = new FileOutputStream(LOAD_TEST_RESULT, true); |