Merge "Sort LayoutTestController methods alphabetically"

This commit is contained in:
Steve Block
2010-09-14 08:25:26 -07:00
committed by Android (Google) Code Review
2 changed files with 77 additions and 79 deletions

View File

@@ -35,12 +35,9 @@ public class LayoutTestController {
mLayoutTestsExecutor = layoutTestsExecutor;
}
public void waitUntilDone() {
mLayoutTestsExecutor.waitUntilDone();
}
public void notifyDone() {
mLayoutTestsExecutor.notifyDone();
public void clearAllDatabases() {
Log.i(LOG_TAG, "clearAllDatabases() called");
WebStorage.getInstance().deleteAllData();
}
public void dumpAsText() {
@@ -55,19 +52,22 @@ public class LayoutTestController {
mLayoutTestsExecutor.dumpChildFramesAsText();
}
public void clearAllDatabases() {
Log.i(LOG_TAG, "clearAllDatabases() called");
WebStorage.getInstance().deleteAllData();
public void dumpDatabaseCallbacks() {
mLayoutTestsExecutor.dumpDatabaseCallbacks();
}
public void notifyDone() {
mLayoutTestsExecutor.notifyDone();
}
public void overridePreference(String key, boolean value) {
mLayoutTestsExecutor.overridePreference(key, value);
}
public void setCanOpenWindows() {
mLayoutTestsExecutor.setCanOpenWindows();
}
public void dumpDatabaseCallbacks() {
mLayoutTestsExecutor.dumpDatabaseCallbacks();
}
public void setDatabaseQuota(long quota) {
/** TODO: Reset this before every test! */
Log.i(LOG_TAG, "setDatabaseQuota() called with: " + quota);
@@ -79,21 +79,6 @@ public class LayoutTestController {
mLayoutTestsExecutor.setGeolocationPermission(allow);
}
public void overridePreference(String key, boolean value) {
mLayoutTestsExecutor.overridePreference(key, value);
}
public void setMockGeolocationPosition(double latitude, double longitude, double accuracy) {
Log.i(LOG_TAG, "setMockGeolocationPosition(): " + "latitude=" + latitude +
" longitude=" + longitude + " accuracy=" + accuracy);
MockGeolocation.getInstance().setPosition(latitude, longitude, accuracy);
}
public void setMockGeolocationError(int code, String message) {
Log.i(LOG_TAG, "setMockGeolocationError(): " + "code=" + code + " message=" + message);
MockGeolocation.getInstance().setError(code, message);
}
public void setMockDeviceOrientation(boolean canProvideAlpha, double alpha,
boolean canProvideBeta, double beta, boolean canProvideGamma, double gamma) {
// Configuration is in WebKit, so stay on WebCore thread, but go via LayoutTestsExecutor
@@ -104,4 +89,19 @@ public class LayoutTestController {
mLayoutTestsExecutor.setMockDeviceOrientation(
canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
}
}
public void setMockGeolocationError(int code, String message) {
Log.i(LOG_TAG, "setMockGeolocationError(): " + "code=" + code + " message=" + message);
MockGeolocation.getInstance().setError(code, message);
}
public void setMockGeolocationPosition(double latitude, double longitude, double accuracy) {
Log.i(LOG_TAG, "setMockGeolocationPosition(): " + "latitude=" + latitude +
" longitude=" + longitude + " accuracy=" + accuracy);
MockGeolocation.getInstance().setPosition(latitude, longitude, accuracy);
}
public void waitUntilDone() {
mLayoutTestsExecutor.waitUntilDone();
}
}

View File

@@ -519,24 +519,12 @@ public class LayoutTestsExecutor extends Activity {
assert mCurrentState.isRunningState() : "mCurrentState = " + mCurrentState.name();
switch (msg.what) {
case MSG_WAIT_UNTIL_DONE:
mCurrentState = CurrentState.WAITING_FOR_ASYNCHRONOUS_TEST;
break;
case MSG_NOTIFY_DONE:
if (mCurrentState == CurrentState.WAITING_FOR_ASYNCHRONOUS_TEST) {
onTestFinished();
}
break;
case MSG_DUMP_AS_TEXT:
if (mCurrentResult == null) {
mCurrentResult = new TextResult(mCurrentTestRelativePath);
}
assert mCurrentResult instanceof TextResult
: "mCurrentResult instanceof" + mCurrentResult.getClass().getName();
break;
case MSG_DUMP_CHILD_FRAMES_AS_TEXT:
@@ -551,27 +539,13 @@ public class LayoutTestsExecutor extends Activity {
((TextResult)mCurrentResult).setDumpChildFramesAsText(true);
break;
case MSG_SET_CAN_OPEN_WINDOWS:
mCanOpenWindows = true;
break;
case MSG_DUMP_DATABASE_CALLBACKS:
mDumpDatabaseCallbacks = true;
break;
case MSG_SET_GEOLOCATION_PERMISSION:
mIsGeolocationPermissionSet = true;
mGeolocationPermission = msg.arg1 == 1;
if (mPendingGeolocationPermissionCallbacks != null) {
Iterator<GeolocationPermissions.Callback> iter =
mPendingGeolocationPermissionCallbacks.keySet().iterator();
while (iter.hasNext()) {
GeolocationPermissions.Callback callback = iter.next();
String origin = mPendingGeolocationPermissionCallbacks.get(callback);
callback.invoke(origin, mGeolocationPermission, false);
}
mPendingGeolocationPermissionCallbacks = null;
case MSG_NOTIFY_DONE:
if (mCurrentState == CurrentState.WAITING_FOR_ASYNCHRONOUS_TEST) {
onTestFinished();
}
break;
@@ -591,6 +565,30 @@ public class LayoutTestsExecutor extends Activity {
}
break;
case MSG_SET_CAN_OPEN_WINDOWS:
mCanOpenWindows = true;
break;
case MSG_SET_GEOLOCATION_PERMISSION:
mIsGeolocationPermissionSet = true;
mGeolocationPermission = msg.arg1 == 1;
if (mPendingGeolocationPermissionCallbacks != null) {
Iterator<GeolocationPermissions.Callback> iter =
mPendingGeolocationPermissionCallbacks.keySet().iterator();
while (iter.hasNext()) {
GeolocationPermissions.Callback callback = iter.next();
String origin = mPendingGeolocationPermissionCallbacks.get(callback);
callback.invoke(origin, mGeolocationPermission, false);
}
mPendingGeolocationPermissionCallbacks = null;
}
break;
case MSG_WAIT_UNTIL_DONE:
mCurrentState = CurrentState.WAITING_FOR_ASYNCHRONOUS_TEST;
break;
default:
assert false : "msg.what=" + msg.what;
break;
@@ -605,16 +603,6 @@ public class LayoutTestsExecutor extends Activity {
mPendingGeolocationPermissionCallbacks = null;
}
public void waitUntilDone() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": waitUntilDone() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_WAIT_UNTIL_DONE);
}
public void notifyDone() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": notifyDone() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_NOTIFY_DONE);
}
public void dumpAsText(boolean enablePixelTest) {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": dumpAsText(" + enablePixelTest + ") called");
/** TODO: Implement */
@@ -629,22 +617,14 @@ public class LayoutTestsExecutor extends Activity {
mLayoutTestControllerHandler.sendEmptyMessage(MSG_DUMP_CHILD_FRAMES_AS_TEXT);
}
public void setCanOpenWindows() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": setCanOpenWindows() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_SET_CAN_OPEN_WINDOWS);
}
public void dumpDatabaseCallbacks() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": dumpDatabaseCallbacks() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_DUMP_DATABASE_CALLBACKS);
}
public void setGeolocationPermission(boolean allow) {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": setGeolocationPermission(" + allow +
") called");
Message msg = mLayoutTestControllerHandler.obtainMessage(MSG_SET_GEOLOCATION_PERMISSION);
msg.arg1 = allow ? 1 : 0;
msg.sendToTarget();
public void notifyDone() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": notifyDone() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_NOTIFY_DONE);
}
public void overridePreference(String key, boolean value) {
@@ -656,6 +636,19 @@ public class LayoutTestsExecutor extends Activity {
msg.sendToTarget();
}
public void setCanOpenWindows() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": setCanOpenWindows() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_SET_CAN_OPEN_WINDOWS);
}
public void setGeolocationPermission(boolean allow) {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": setGeolocationPermission(" + allow +
") called");
Message msg = mLayoutTestControllerHandler.obtainMessage(MSG_SET_GEOLOCATION_PERMISSION);
msg.arg1 = allow ? 1 : 0;
msg.sendToTarget();
}
public void setMockDeviceOrientation(boolean canProvideAlpha, double alpha,
boolean canProvideBeta, double beta, boolean canProvideGamma, double gamma) {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": setMockDeviceOrientation(" + canProvideAlpha +
@@ -664,4 +657,9 @@ public class LayoutTestsExecutor extends Activity {
mCurrentWebView.setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta,
canProvideGamma, gamma);
}
public void waitUntilDone() {
Log.i(LOG_TAG, mCurrentTestRelativePath + ": waitUntilDone() called");
mLayoutTestControllerHandler.sendEmptyMessage(MSG_WAIT_UNTIL_DONE);
}
}