diff options
author | Guang Zhu <guangzhu@google.com> | 2009-08-03 10:47:44 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2009-08-03 12:18:40 -0700 |
commit | 8c5b3e2fa60e29e45c97bf83b2aa8c6505987f82 (patch) | |
tree | ae5115264b8b41aeedaa1aff6388ae5e728e393c /tests/DumpRenderTree | |
parent | bf3e69efacadd9186604a53fee0e6734b1723bcd (diff) | |
download | frameworks_base-8c5b3e2fa60e29e45c97bf83b2aa8c6505987f82.zip frameworks_base-8c5b3e2fa60e29e45c97bf83b2aa8c6505987f82.tar.gz frameworks_base-8c5b3e2fa60e29e45c97bf83b2aa8c6505987f82.tar.bz2 |
Change browser reliability test to start a new activity for each url
Diffstat (limited to 'tests/DumpRenderTree')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java | 11 | ||||
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java index de39800..71d9758 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java @@ -1,5 +1,7 @@ package com.android.dumprendertree; +import android.app.Activity; +import android.content.Intent; import android.os.Handler; import android.os.Message; import android.test.ActivityInstrumentationTestCase2; @@ -33,7 +35,7 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit } public void runReliabilityTest() throws Throwable { - ReliabilityTestActivity activity = getActivity(); +// ReliabilityTestActivity activity = getActivity(); LayoutTestsAutoRunner runner = (LayoutTestsAutoRunner)getInstrumentation(); File testListFile = new File(TEST_LIST_FILE); @@ -54,6 +56,8 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit boolean timeoutFlag = false; long start, elapsed; + Intent intent = new Intent(runner.getContext(), ReliabilityTestActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //read from BufferedReader instead of populating a list in advance, //this will avoid excessive memory usage in case of a large list while((url = listReader.readLine()) != null) { @@ -63,6 +67,8 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit start = System.currentTimeMillis(); Log.v(LOGTAG, "Testing URL: " + url); FsUtils.updateTestStatus(TEST_STATUS_FILE, url); + ReliabilityTestActivity activity = (ReliabilityTestActivity)runner.startActivitySync( + intent); activity.reset(); //use message to send new URL to avoid interacting with //WebView in non-UI thread @@ -88,12 +94,13 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2<Reliabilit if(runner.mLogtime) { writeLoadTime(url, activity.getPageLoadTime()); } + activity.finish(); System.runFinalization(); System.gc(); System.gc(); } FsUtils.updateTestStatus(TEST_STATUS_FILE, TEST_DONE); - activity.finish(); +// activity.finish(); listReader.close(); } diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java index 5ddd0b3..db40daf 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTestActivity.java @@ -122,8 +122,9 @@ public class ReliabilityTestActivity extends Activity { @Override protected void onDestroy() { - Log.v(LOGTAG, "onDestroy, inst=" + Integer.toHexString(hashCode())); super.onDestroy(); + Log.v(LOGTAG, "onDestroy, inst=" + Integer.toHexString(hashCode())); + webView.destroy(); } private boolean isPageDone() { @@ -270,8 +271,7 @@ public class ReliabilityTestActivity extends Activity { } public void run() { - if (initialStartCount == pageStartCount) { - //perform cleanup + if (initialStartCount == pageStartCount && !isPageDone()) { handler.removeMessages(MSG_TIMEOUT); webView.stopLoading(); handler.postDelayed(pageDoneRunner, manualDelay); |