diff options
| author | Maksymilian Osowski <maxosowski@google.com> | 2010-08-26 09:12:09 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-26 09:12:09 -0700 |
| commit | 6db53149ca44385caea82dd14b89ad5cd958af02 (patch) | |
| tree | e43b347449c0270b9dcf805b330f3e5783067be1 /tests | |
| parent | 9d660cb5f3202366ad8540d66018b33b3f8578df (diff) | |
| parent | 2e5982a55ac031110ed39515a76f7a5ec9ff2c14 (diff) | |
| download | frameworks_base-6db53149ca44385caea82dd14b89ad5cd958af02.zip frameworks_base-6db53149ca44385caea82dd14b89ad5cd958af02.tar.gz frameworks_base-6db53149ca44385caea82dd14b89ad5cd958af02.tar.bz2 | |
Merge "Tweaked the logging + some minor style fixes."
Diffstat (limited to 'tests')
8 files changed, 51 insertions, 37 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/AdditionalTextOutput.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/AdditionalTextOutput.java index 8fca629..bb9a916 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/AdditionalTextOutput.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/AdditionalTextOutput.java @@ -63,7 +63,8 @@ public class AdditionalTextOutput { port = url.getPort(); } } catch (MalformedURLException e) { - Log.e(LOG_TAG + "::appendDatabaseCallback", e.getMessage()); + Log.e(LOG_TAG, "urlString=" + urlString + " databaseIdentifier=" + databaseIdentifier, + e); } output.append("UI DELEGATE DATABASE CALLBACK: "); diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/FileFilter.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/FileFilter.java index cf82d24..bcc8564 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/FileFilter.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/FileFilter.java @@ -124,9 +124,10 @@ public class FileFilter { } } } catch (FileNotFoundException e) { - Log.w(LOG_TAG + "::reloadConfiguration", "File not found: " + txt_exp.getPath()); + Log.w(LOG_TAG, "mRootDirPath=" + mRootDirPath + ": File not found: " + + txt_exp.getPath(), e); } catch (IOException e) { - Log.e(LOG_TAG + "::reloadConfiguration", "IOException: " + e.getMessage()); + Log.e(LOG_TAG, "mRootDirPath=" + mRootDirPath, e); } } diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/FsUtils.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/FsUtils.java index 212c187..0cfe69d 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/FsUtils.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/FsUtils.java @@ -31,13 +31,13 @@ public class FsUtils { public static final String LOG_TAG = "FsUtils"; public static void writeDataToStorage(File file, byte[] bytes, boolean append) { - Log.d(LOG_TAG + "::writeDataToStorage", file.getAbsolutePath()); + Log.d(LOG_TAG, "writeDataToStorage(): " + file.getAbsolutePath()); try { OutputStream outputStream = null; try { file.getParentFile().mkdirs(); file.createNewFile(); - Log.d(LOG_TAG + "::writeDataToStorage", "File created."); + Log.d(LOG_TAG, "writeDataToStorage(): File created."); outputStream = new FileOutputStream(file, append); outputStream.write(bytes); } finally { @@ -46,13 +46,13 @@ public class FsUtils { } } } catch (IOException e) { - Log.e(LOG_TAG + "::writeDataToStorage", e.getMessage()); + Log.e(LOG_TAG, "file.getAbsolutePath=" + file.getAbsolutePath(), e); } } public static byte[] readDataFromStorage(File file) { if (!file.exists()) { - Log.d(LOG_TAG + "::readDataFromStorage", "File does not exist: " + Log.d(LOG_TAG, "readDataFromStorage(): File does not exist: " + file.getAbsolutePath()); return null; } @@ -70,7 +70,7 @@ public class FsUtils { } } } catch (IOException e) { - Log.e(LOG_TAG + "::readDataFromStorage", e.getMessage()); + Log.e(LOG_TAG, "file.getAbsolutePath=" + file.getAbsolutePath(), e); } return bytes; diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java index 6db9571..7d57eb7 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java @@ -56,7 +56,7 @@ public class LayoutTestController { } public void clearAllDatabases() { - Log.w(LOG_TAG + "::clearAllDatabases", "called"); + Log.i(LOG_TAG, "clearAllDatabases() called"); WebStorage.getInstance().deleteAllData(); } @@ -70,7 +70,7 @@ public class LayoutTestController { public void setDatabaseQuota(long quota) { /** TODO: Reset this before every test! */ - Log.w(LOG_TAG + "::setDatabaseQuota", "called with: " + quota); + Log.i(LOG_TAG, "setDatabaseQuota() called with: " + quota); WebStorage.getInstance().setQuotaForOrigin(Uri.fromFile(new File("")).toString(), quota); } @@ -80,13 +80,13 @@ public class LayoutTestController { } public void setMockGeolocationPosition(double latitude, double longitude, double accuracy) { - Log.w(LOG_TAG + "::setMockGeolocationPosition", "latitude: " + latitude + - " longitude: " + longitude + " accuracy: " + 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.w(LOG_TAG + "::setMockGeolocationError", "code: " + code + " message: " + message); + Log.i(LOG_TAG, "setMockGeolocationError(): " + "code=" + code + " message=" + message); MockGeolocation.getInstance().setError(code, message); } @@ -94,7 +94,10 @@ public class LayoutTestController { boolean canProvideBeta, double beta, boolean canProvideGamma, double gamma) { // Configuration is in WebKit, so stay on WebCore thread, but go via LayoutTestsExecutor // as we need access to the Webview. + Log.i(LOG_TAG, "setMockDeviceOrientation(" + canProvideAlpha + + ", " + alpha + ", " + canProvideBeta + ", " + beta + ", " + canProvideGamma + + ", " + gamma + ")"); mLayoutTestsExecutor.setMockDeviceOrientation( canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); } -} +}
\ No newline at end of file diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java index 4737657..d17ec7c 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java @@ -112,7 +112,7 @@ public class LayoutTestsExecutor extends Activity { private boolean mDumpDatabaseCallbacks; private boolean mIsGeolocationPermissionSet; private boolean mGeolocationPermission; - private Map mPendingGeolocationPermissionCallbacks; + private Map<GeolocationPermissions.Callback, String> mPendingGeolocationPermissionCallbacks; private EventSender mEventSender = new EventSender(); @@ -338,7 +338,7 @@ public class LayoutTestsExecutor extends Activity { serviceMsg.setData(bundle); mManagerServiceMessenger.send(serviceMsg); } catch (RemoteException e) { - Log.e(LOG_TAG + "::startTests", e.getMessage()); + Log.e(LOG_TAG, "mCurrentTestRelativePath=" + mCurrentTestRelativePath, e); } runNextTest(); @@ -369,6 +369,7 @@ public class LayoutTestsExecutor extends Activity { private void onTestTimedOut() { assert mCurrentState.isRunningState() : "mCurrentState = " + mCurrentState.name(); + Log.w(LOG_TAG, "onTestTimedOut(): " + mCurrentTestRelativePath); mCurrentTestTimedOut = true; /** @@ -383,6 +384,7 @@ public class LayoutTestsExecutor extends Activity { private void onTestFinished() { assert mCurrentState.isRunningState() : "mCurrentState = " + mCurrentState.name(); + Log.i(LOG_TAG, "onTestFinished(): " + mCurrentTestRelativePath); obtainActualResultsFromWebView(); } @@ -406,6 +408,7 @@ public class LayoutTestsExecutor extends Activity { assert mCurrentState == CurrentState.OBTAINING_RESULT : "mCurrentState = " + mCurrentState.name(); + Log.i(LOG_TAG, "onActualResultsObtained(): " + mCurrentTestRelativePath); mCurrentState = CurrentState.IDLE; mResultHandler.removeMessages(MSG_TEST_TIMED_OUT); @@ -436,7 +439,7 @@ public class LayoutTestsExecutor extends Activity { serviceMsg.setData(bundle); mManagerServiceMessenger.send(serviceMsg); } catch (RemoteException e) { - Log.e(LOG_TAG + "::reportResultToService", e.getMessage()); + Log.e(LOG_TAG, "mCurrentTestRelativePath=" + mCurrentTestRelativePath, e); } } @@ -455,7 +458,7 @@ public class LayoutTestsExecutor extends Activity { Message.obtain(null, ManagerService.MSG_ALL_TESTS_FINISHED); mManagerServiceMessenger.send(serviceMsg); } catch (RemoteException e) { - Log.e(LOG_TAG + "::onAllTestsFinished", e.getMessage()); + Log.e(LOG_TAG, "mCurrentTestRelativePath=" + mCurrentTestRelativePath, e); } unbindService(mServiceConnection); @@ -529,11 +532,11 @@ public class LayoutTestsExecutor extends Activity { mGeolocationPermission = msg.arg1 == 1; if (mPendingGeolocationPermissionCallbacks != null) { - Iterator iter = mPendingGeolocationPermissionCallbacks.keySet().iterator(); + Iterator<GeolocationPermissions.Callback> iter = + mPendingGeolocationPermissionCallbacks.keySet().iterator(); while (iter.hasNext()) { - GeolocationPermissions.Callback callback = - (GeolocationPermissions.Callback) iter.next(); - String origin = (String) mPendingGeolocationPermissionCallbacks.get(callback); + GeolocationPermissions.Callback callback = iter.next(); + String origin = mPendingGeolocationPermissionCallbacks.get(callback); callback.invoke(origin, mGeolocationPermission, false); } mPendingGeolocationPermissionCallbacks = null; @@ -541,7 +544,7 @@ public class LayoutTestsExecutor extends Activity { break; default: - Log.w(LOG_TAG + "::handleMessage", "Message code does not exist: " + msg.what); + assert false : "msg.what=" + msg.what; break; } } @@ -555,41 +558,42 @@ public class LayoutTestsExecutor extends Activity { } public void waitUntilDone() { - Log.w(LOG_TAG + "::waitUntilDone", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": waitUntilDone() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_WAIT_UNTIL_DONE); } public void notifyDone() { - Log.w(LOG_TAG + "::notifyDone", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": notifyDone() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_NOTIFY_DONE); } public void dumpAsText(boolean enablePixelTest) { - Log.w(LOG_TAG + "::dumpAsText(" + enablePixelTest + ")", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": dumpAsText(" + enablePixelTest + ") called"); /** TODO: Implement */ if (enablePixelTest) { - Log.w(LOG_TAG + "::dumpAsText", "enablePixelTest not implemented, switching to false"); + Log.w(LOG_TAG, "enablePixelTest not implemented, switching to false"); } mLayoutTestControllerHandler.sendEmptyMessage(MSG_DUMP_AS_TEXT); } public void dumpChildFramesAsText() { - Log.w(LOG_TAG + "::dumpChildFramesAsText", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": dumpChildFramesAsText() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_DUMP_CHILD_FRAMES_AS_TEXT); } public void setCanOpenWindows() { - Log.w(LOG_TAG + "::setCanOpenWindows", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": setCanOpenWindows() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_SET_CAN_OPEN_WINDOWS); } public void dumpDatabaseCallbacks() { - Log.w(LOG_TAG + "::dumpDatabaseCallbacks:", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": dumpDatabaseCallbacks() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_DUMP_DATABASE_CALLBACKS); } public void setGeolocationPermission(boolean allow) { - Log.w(LOG_TAG + "::setGeolocationPermission", "called"); + Log.i(LOG_TAG, mCurrentTestRelativePath + ": setGeolocationPermission(" + allow + + ") called"); Message msg = mLayoutTestControllerHandler.obtainMessage(MSG_SET_GEOLOCATION_PERMISSION); msg.arg1 = allow ? 1 : 0; msg.sendToTarget(); @@ -597,7 +601,10 @@ public class LayoutTestsExecutor extends Activity { public void setMockDeviceOrientation(boolean canProvideAlpha, double alpha, boolean canProvideBeta, double beta, boolean canProvideGamma, double gamma) { + Log.i(LOG_TAG, mCurrentTestRelativePath + ": setMockDeviceOrientation(" + canProvideAlpha + + ", " + alpha + ", " + canProvideBeta + ", " + beta + ", " + canProvideGamma + + ", " + gamma + ")"); mCurrentWebView.setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); } -} +}
\ No newline at end of file diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java index 31026d6..951126f 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/ManagerService.java @@ -88,7 +88,7 @@ public class ManagerService extends Service { break; case MSG_PROCESS_ACTUAL_RESULTS: - Log.d(LOG_TAG + ".mIncomingHandler", msg.getData().getString("relativePath")); + Log.d(LOG_TAG,"mIncomingHandler: " + msg.getData().getString("relativePath")); onActualResultsObtained(msg.getData()); break; @@ -151,11 +151,13 @@ public class ManagerService extends Service { AbstractResult results = AbstractResult.TestType.valueOf(bundle.getString("type")).createResult(bundle); + Log.i(LOG_TAG, "onActualResultObtained: " + results.getRelativePath()); handleResults(results); } private void ensureNextTestSetup(String nextTest, int index) { if (nextTest == null) { + Log.w(LOG_TAG, "ensureNextTestSetup(): nextTest=null"); return; } @@ -172,8 +174,8 @@ public class ManagerService extends Service { private void onTestCrashed() { handleResults(new CrashedDummyResult(mCurrentlyRunningTest)); - Log.w(LOG_TAG + "::onTestCrashed", mCurrentlyRunningTest + - "(" + mCurrentlyRunningTestIndex + ")"); + Log.w(LOG_TAG, "onTestCrashed(): " + mCurrentlyRunningTest + + " (" + mCurrentlyRunningTestIndex + ")"); Intent intent = new Intent(this, TestsListActivity.class); intent.setAction(Intent.ACTION_REBOOT); diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/VisualDiffUtils.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/VisualDiffUtils.java index 250b6bc..26bf75c 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/VisualDiffUtils.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/VisualDiffUtils.java @@ -204,4 +204,4 @@ public class VisualDiffUtils { } return html.toString(); } -} +}
\ No newline at end of file diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/scriptsupport/Starter.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/scriptsupport/Starter.java index ddfae69..e730c8a 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/scriptsupport/Starter.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/scriptsupport/Starter.java @@ -66,7 +66,7 @@ public class Starter extends ActivityInstrumentationTestCase2<TestsListActivity> try { this.wait(); } catch (InterruptedException e) { - Log.e(LOG_TAG + "::startLayoutTests", e.getMessage()); + Log.e(LOG_TAG, "startLayoutTests()", e); } } } |
