summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java26
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java11
2 files changed, 17 insertions, 20 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
index 39eae02940d2..910cb8dedcd7 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
@@ -16,24 +16,11 @@
package com.android.dumprendertree;
-import android.app.Activity;
import android.app.Instrumentation;
-import android.app.Instrumentation.ActivityMonitor;
-import android.content.ContentResolver;
-import android.content.ContentValues;
import android.content.Intent;
-
-import android.util.Log;
-import android.view.KeyEvent;
-import android.webkit.WebSettings;
-
import android.os.Bundle;
-import android.os.Message;
import android.test.ActivityInstrumentationTestCase2;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.LargeTest;
-
-import com.android.dumprendertree.TestShellActivity;
+import android.util.Log;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
@@ -141,6 +128,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
private Vector<String> mTestList;
private boolean mRebaselineResults;
private String mTestPathPrefix;
+ private boolean mFinished;
public LayoutTestsAutoTest() {
super("com.android.dumprendertree", TestShellActivity.class);
@@ -290,6 +278,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
activity.setCallback(new TestShellCallback() {
public void finished() {
synchronized (LayoutTestsAutoTest.this) {
+ mFinished = true;
LayoutTestsAutoTest.this.notifyAll();
}
}
@@ -306,6 +295,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
resultFile = getAndroidExpectedResultFile(expectedResultFile);
}
+ mFinished = false;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClass(activity, TestShellActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
@@ -316,9 +306,11 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
// Wait until done.
synchronized (this) {
- try {
- this.wait();
- } catch (InterruptedException e) { }
+ while(!mFinished){
+ try {
+ this.wait();
+ } catch (InterruptedException e) { }
+ }
}
if (!mRebaselineResults) {
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java
index 9e1e9ed253b0..e793ed4d3f99 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java
@@ -37,6 +37,7 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel
private final static String LOGTAG = "LoadTest";
private final static String LOAD_TEST_RESULT = "/sdcard/load_test_result.txt";
+ private boolean mFinished;
public LoadTestsAutoTest() {
super("com.android.dumprendertree", TestShellActivity.class);
@@ -124,11 +125,13 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel
activity.setCallback(new TestShellCallback() {
public void finished() {
synchronized (LoadTestsAutoTest.this) {
+ mFinished = true;
LoadTestsAutoTest.this.notifyAll();
}
}
});
+ mFinished = false;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClass(activity, TestShellActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
@@ -139,9 +142,11 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel
// Wait until done.
synchronized (this) {
- try {
- this.wait();
- } catch (InterruptedException e) { }
+ while(!mFinished) {
+ try {
+ this.wait();
+ } catch (InterruptedException e) { }
+ }
}
}
}