summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-05-25 20:12:47 +0100
committerKristian Monsen <kristianm@google.com>2010-05-25 20:12:47 +0100
commit521d9a798613cc9ad850f42343d2fbfa6c98f5c7 (patch)
tree4c09aa42f85a616bcea2df7d7e78093bb2e5ba3b /tests/DumpRenderTree
parentdcea182c9a8eaa0895a3b675a695791df06d9d5e (diff)
downloadframeworks_base-521d9a798613cc9ad850f42343d2fbfa6c98f5c7.zip
frameworks_base-521d9a798613cc9ad850f42343d2fbfa6c98f5c7.tar.gz
frameworks_base-521d9a798613cc9ad850f42343d2fbfa6c98f5c7.tar.bz2
Display index and count when running layout tests
Change-Id: I8b925784aead96a1be6344d654d0376dee2047eb
Diffstat (limited to 'tests/DumpRenderTree')
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java10
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java11
2 files changed, 16 insertions, 5 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
index 6b9bd65..150d65c 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
@@ -153,6 +153,8 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
private String mJsEngine;
private String mTestPathPrefix;
private boolean mFinished;
+ private int mTestCount;
+ private int mResumeIndex = 0;
public LayoutTestsAutoTest() {
super(TestShellActivity.class);
@@ -176,6 +178,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
} catch (Exception e) {
Log.e(LOGTAG, "Error while reading test list : " + e.getMessage());
}
+ mTestCount = mTestList.size();
}
private void resumeTestList() {
@@ -186,6 +189,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
if (mTestList.elementAt(i).equals(line)) {
mTestList = new Vector<String>(mTestList.subList(i+1, mTestList.size()));
mTestListIgnoreResult = new Vector<Boolean>(mTestListIgnoreResult.subList(i+1, mTestListIgnoreResult.size()));
+ mResumeIndex = i;
break;
}
}
@@ -286,7 +290,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
}
}
- private void runTestAndWaitUntilDone(TestShellActivity activity, String test, int timeout, boolean ignoreResult) {
+ private void runTestAndWaitUntilDone(TestShellActivity activity, String test, int timeout, boolean ignoreResult, int testIndex) {
activity.setCallback(new TestShellCallback() {
public void finished() {
synchronized (LayoutTestsAutoTest.this) {
@@ -322,6 +326,8 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
intent.putExtra(TestShellActivity.TEST_URL, FsUtils.getTestUrl(test));
intent.putExtra(TestShellActivity.RESULT_FILE, resultFile);
intent.putExtra(TestShellActivity.TIMEOUT_IN_MILLIS, timeout);
+ intent.putExtra(TestShellActivity.TEST_COUNT, mTestCount);
+ intent.putExtra(TestShellActivity.TEST_INDEX, testIndex);
activity.startActivity(intent);
// Wait until done.
@@ -396,7 +402,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
boolean ignoreResult = mTestListIgnoreResult.elementAt(i);
FsUtils.updateTestStatus(TEST_STATUS_FILE, s);
// Run tests
- runTestAndWaitUntilDone(activity, s, runner.mTimeoutInMillis, ignoreResult);
+ runTestAndWaitUntilDone(activity, s, runner.mTimeoutInMillis, ignoreResult, i + 1 + mResumeIndex);
}
FsUtils.updateTestStatus(TEST_STATUS_FILE, "#DONE");
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
index 2b1a781..553aac6 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
@@ -172,6 +172,9 @@ public class TestShellActivity extends Activity implements LayoutTestController
mTimeoutInMillis = intent.getIntExtra(TIMEOUT_IN_MILLIS, 0);
mGetDrawtime = intent.getBooleanExtra(GET_DRAW_TIME, false);
mSaveImagePath = intent.getStringExtra(SAVE_IMAGE);
+ mTestCount = intent.getIntExtra(TEST_COUNT, 0);
+ mTestIndex = intent.getIntExtra(TEST_INDEX, 0);
+ setTitle("Test " + mTestIndex + " of " + mTestCount);
Log.v(LOGTAG, " Loading " + mTestUrl);
mWebView.loadUrl(mTestUrl);
@@ -571,9 +574,7 @@ public class TestShellActivity extends Activity implements LayoutTestController
@Override
public void onReceivedTitle(WebView view, String title) {
- if (title.length() > 30)
- title = "..."+title.substring(title.length()-30);
- setTitle(title);
+ setTitle("Test " + mTestIndex + " of " + mTestCount + ": "+ title);
if (mDumpTitleChanges) {
mTitleChanges.append("TITLE CHANGED: ");
mTitleChanges.append(title);
@@ -842,6 +843,8 @@ public class TestShellActivity extends Activity implements LayoutTestController
private String mSaveImagePath;
private BufferedReader mTestListReader;
private boolean mGetDrawtime;
+ private int mTestCount;
+ private int mTestIndex;
// States
private boolean mTimedOut;
@@ -879,6 +882,8 @@ public class TestShellActivity extends Activity implements LayoutTestController
static final String UI_AUTO_TEST = "UiAutoTest";
static final String GET_DRAW_TIME = "GetDrawTime";
static final String SAVE_IMAGE = "SaveImage";
+ static final String TEST_COUNT = "TestCount";
+ static final String TEST_INDEX = "TestIndex";
static final int DRAW_RUNS = 5;
static final String DRAW_TIME_LOG = "/sdcard/android/page_draw_time.txt";