summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-04-20 16:54:55 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2009-04-20 16:54:55 -0700
commitdcd51165a920de782fe69ed1852c6963540f03e9 (patch)
tree36f251cb508fb89bfb28e37047028555ab2cec34
parent486d95f71425726d69227fdf25ddd2b016529a50 (diff)
parent20b4935f2a8114bb95e8692490ec141bb6731475 (diff)
Merge change 326
* changes: modify wait mechanism so that it checks whether activity has already finished or not first
-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) { }
+ }
}
}
}