summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2010-07-14 17:17:54 -0700
committerGuang Zhu <guangzhu@google.com>2010-07-14 17:26:02 -0700
commit5d53c19a10ab677d2ebcec0bfecc3b628663f407 (patch)
tree70fb9ae18ddd8dc41a44584d56a6697930555db7 /tests/DumpRenderTree
parent71ecab2d89122535a8bb1f589bc8d920aaedaa7c (diff)
downloadframeworks_base-5d53c19a10ab677d2ebcec0bfecc3b628663f407.zip
frameworks_base-5d53c19a10ab677d2ebcec0bfecc3b628663f407.tar.gz
frameworks_base-5d53c19a10ab677d2ebcec0bfecc3b628663f407.tar.bz2
add a paramter to control page-load-termination-on-JS-error
A previous change terminates page load if there's certain JS errors; the intention was to speed up layout tests such that page accessing non-existent test controllers/methods will get immediate termination instead of waiting on timeout. However this causes problem for page cycler because it may interrupt the test run too early. Also there was a bug on bracketing on the termination conditions (operator precendence issue). Change-Id: I2f19e48fa0061286fddf0f7cbb4953d7f7d88f76
Diffstat (limited to 'tests/DumpRenderTree')
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java1
-rw-r--r--tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java7
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
index 68d01d4..3618c7b 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoTest.java
@@ -336,6 +336,7 @@ public class LayoutTestsAutoTest extends ActivityInstrumentationTestCase2<TestSh
intent.putExtra(TestShellActivity.TIMEOUT_IN_MILLIS, timeout);
intent.putExtra(TestShellActivity.TOTAL_TEST_COUNT, mTestCount);
intent.putExtra(TestShellActivity.CURRENT_TEST_NUMBER, testNumber);
+ intent.putExtra(TestShellActivity.STOP_ON_REF_ERROR, true);
activity.startActivity(intent);
// Wait until done.
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
index 0a04712..bf66fae 100644
--- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
+++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java
@@ -179,6 +179,7 @@ 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);
+ mStopOnRefError = intent.getBooleanExtra(STOP_ON_REF_ERROR, false);
setTitle("Test " + mCurrentTestNumber + " of " + mTotalTestCount);
float ratio = (float)mCurrentTestNumber / mTotalTestCount;
int progress = (int)(ratio * Window.PROGRESS_END);
@@ -699,8 +700,8 @@ public class TestShellActivity extends Activity implements LayoutTestController
// waiting for "notifyDone" signal to finish, then there's no point in waiting
// anymore because the JS execution is already terminated at this point and a
// "notifyDone" will never come out so it's just wasting time till timeout kicks in
- if (msg.contains("Uncaught ReferenceError:") || msg.contains("Uncaught TypeError:")
- && mWaitUntilDone) {
+ if ((msg.contains("Uncaught ReferenceError:") || msg.contains("Uncaught TypeError:"))
+ && mWaitUntilDone && mStopOnRefError) {
Log.w(LOGTAG, "Terminating test case on uncaught ReferenceError or TypeError.");
mHandler.postDelayed(new Runnable() {
public void run() {
@@ -857,6 +858,7 @@ public class TestShellActivity extends Activity implements LayoutTestController
private boolean mGetDrawtime;
private int mTotalTestCount;
private int mCurrentTestNumber;
+ private boolean mStopOnRefError;
// States
private boolean mTimedOut;
@@ -897,6 +899,7 @@ public class TestShellActivity extends Activity implements LayoutTestController
static final String SAVE_IMAGE = "SaveImage";
static final String TOTAL_TEST_COUNT = "TestCount";
static final String CURRENT_TEST_NUMBER = "TestNumber";
+ static final String STOP_ON_REF_ERROR = "StopOnReferenceError";
static final int DRAW_RUNS = 5;
static final String DRAW_TIME_LOG = "/sdcard/android/page_draw_time.txt";