Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1970)

Unified Diff: content/shell/layout_test_controller_host.cc

Issue 10824351: [content shell] Add support for layout tests using content_shell on Android (first step). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/layout_test_controller.cc ('k') | content/shell/shell_browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/layout_test_controller_host.cc
diff --git a/content/shell/layout_test_controller_host.cc b/content/shell/layout_test_controller_host.cc
index 88ab1769568ef884c12b44ebcc4cf84f379d9f3e..d987809f74ba696bc0f67551f70143d727c56485 100644
--- a/content/shell/layout_test_controller_host.cc
+++ b/content/shell/layout_test_controller_host.cc
@@ -116,11 +116,6 @@ void LayoutTestControllerHost::OnTextDump(const std::string& dump) {
void LayoutTestControllerHost::OnImageDump(
const std::string& actual_pixel_hash,
const SkBitmap& image) {
-#if !defined(OS_ANDROID)
- // DumpRenderTree is not currently supported for Android. Also, on Android
- // the required webkit_support methods are not defined, so this method just
- // doesn't compile.
-
SkAutoLockPixels image_lock(image);
printf("\nActualHash: %s\n", actual_pixel_hash.c_str());
@@ -139,14 +134,27 @@ void LayoutTestControllerHost::OnImageDump(
bool discard_transparency = true;
#endif
- if (webkit_support::EncodeBGRAPNGWithChecksum(
- reinterpret_cast<const unsigned char*>(image.getPixels()),
- image.width(),
- image.height(),
- static_cast<int>(image.rowBytes()),
- discard_transparency,
- actual_pixel_hash,
- &png)) {
+ bool success = false;
+#if defined(OS_ANDROID)
+ success = webkit_support::EncodeRGBAPNGWithChecksum(
+ reinterpret_cast<const unsigned char*>(image.getPixels()),
+ image.width(),
+ image.height(),
+ static_cast<int>(image.rowBytes()),
+ discard_transparency,
+ actual_pixel_hash,
+ &png);
+#else
+ success = webkit_support::EncodeBGRAPNGWithChecksum(
+ reinterpret_cast<const unsigned char*>(image.getPixels()),
+ image.width(),
+ image.height(),
+ static_cast<int>(image.rowBytes()),
+ discard_transparency,
+ actual_pixel_hash,
+ &png);
+#endif
+ if (success) {
printf("Content-Type: image/png\n");
printf("Content-Length: %u\n", static_cast<unsigned>(png.size()));
fwrite(&png[0], 1, png.size(), stdout);
@@ -154,7 +162,6 @@ void LayoutTestControllerHost::OnImageDump(
}
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
-#endif
}
void LayoutTestControllerHost::OnNotifyDone() {
« no previous file with comments | « content/shell/layout_test_controller.cc ('k') | content/shell/shell_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698