diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 00:54:45 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-11 00:54:45 +0000 |
commit | 0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9 (patch) | |
tree | 1015ff7e32d5dff28d103a89c9f9224bd2c0254a /webkit/tools | |
parent | 74c8b421637393234e24b227929b89eba0883e76 (diff) | |
download | chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.zip chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.tar.gz chromium_src-0b0fe3b6803ba1ed2d6b565474d93ccec34fedb9.tar.bz2 |
Reverting 11396.
failing layout tests on linux
Review URL: http://codereview.chromium.org/43058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11409 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 30 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 32 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_shell.cc | 29 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host.h | 12 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 26 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 24 |
8 files changed, 27 insertions, 137 deletions
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 6fd614a..2605a3f 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -134,30 +134,6 @@ DEFER : LayoutTests/fast/html/keygen.html = FAIL DEFER : LayoutTests/fast/invalid/residual-style.html = FAIL // ----------------------------------------------------------------- -// Repaint tests -// ----------------------------------------------------------------- - -// Bug 8630: our repaint baselines are incorrect. - -DEFER : LayoutTests/fast/repaint = FAIL -DEFER : LayoutTests/fast/backgrounds/solid-color-context-restore.html = FAIL -DEFER : LayoutTests/fast/dom/anchor-toString.html = FAIL -DEFER : LayoutTests/fast/dynamic/containing-block-change.html = FAIL -DEFER : LayoutTests/fast/forms/hidden-listbox.html = FAIL -DEFER : LayoutTests/fast/forms/listbox-clip.html = FAIL -DEFER : LayoutTests/fast/frames/inline-object-inside-frameset.html = FAIL -DEFER : LayoutTests/fast/layers/add-layer-with-nested-stacking.html = FAIL -DEFER : LayoutTests/fast/layers/layer-content-visibility-change.html = FAIL -DEFER : LayoutTests/fast/layers/remove-layer-with-nested-stacking.html = FAIL -DEFER : LayoutTests/fast/overflow/hidden-scrollbar-resize.html = FAIL -DEFER : LayoutTests/fast/reflections/inline-crash.html = FAIL -DEFER : LayoutTests/fast/replaced/width100percent-textarea.html = FAIL -DEFER : LayoutTests/fast/table/empty-section-crash.html = FAIL -DEFER : LayoutTests/fast/text/font-initial.html = FAIL -DEFER : LayoutTests/svg/W3C-SVG-1.1/struct-image-05-b.svg = FAIL -DEFER : pending/fast/repaint/bugzilla-6473.html = FAIL - -// ----------------------------------------------------------------- // Other // ----------------------------------------------------------------- @@ -606,8 +582,8 @@ DEFER LINUX WIN : LayoutTests/editing/selection/4960137.html = FAIL // unpainted space (filled red in Debug but not in Release). // https://bugs.webkit.org/show_bug.cgi?id=8423 DEFER : LayoutTests/tables/mozilla_expected_failures/bugs/bug178855.xml = FAIL PASS -// Passes release. Fails debug. Looks like something is going off with repaint too. -DEFER : LayoutTests/fast/flexbox/flex-hang.html = FAIL PASS +// Passes release. Fails debug. +DEFER DEBUG : LayoutTests/fast/flexbox/flex-hang.html = FAIL PASS // Bug: 1166644 // Fails on webkit windows as well. @@ -926,6 +902,7 @@ LINUX WIN : LayoutTests/fast/repaint/overflow-outline-repaint.html = FAIL WIN : LayoutTests/fast/repaint/overflow-scroll-delete.html = FAIL // Likely just needs to be baselined. LINUX MAC : LayoutTests/fast/forms/form-element-geometry.html = FAIL +LINUX MAC : LayoutTests/fast/replaced/width100percent-textarea.html = FAIL LINUX : LayoutTests/fast/text/drawBidiText.html = FAIL LINUX : LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-in-foreign-domain-subframe.html = TIMEOUT PASS LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-to-data-url-sub-frame.html = FAIL @@ -1661,6 +1638,7 @@ DEFER : LayoutTests/fast/dom/getBoundingClientRect-getClientRects-relative-to-vi // Defer until fixed upstream. DEFER LINUX WIN : LayoutTests/fast/overflow/004.html = FAIL // These need to be rebaselined. +LINUX : LayoutTests/fast/overflow/hidden-scrollbar-resize.html = FAIL LINUX : LayoutTests/fast/overflow/hit-test-overflow-controls.html = FAIL // mbelshe to fix. Temporarily disable while tree red. diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 50e0460..affd0da 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -189,7 +189,7 @@ void LayoutTestController::WorkQueue::AddWork(WorkItem* work) { } void LayoutTestController::dumpAsText(const CppArgumentList& args, - CppVariant* result) { + CppVariant* result) { dump_as_text_ = true; result->SetNull(); } @@ -279,7 +279,7 @@ void LayoutTestController::notifyDone( class WorkItemBackForward : public LayoutTestController::WorkItem { public: - explicit WorkItemBackForward(int distance) : distance_(distance) {} + WorkItemBackForward(int distance) : distance_(distance) {} void Run(TestShell* shell) { shell->GoBackOrForward(distance_); } @@ -316,7 +316,7 @@ void LayoutTestController::queueReload( class WorkItemScript : public LayoutTestController::WorkItem { public: - explicit WorkItemScript(const string& script) : script_(script) {} + WorkItemScript(const string& script) : script_(script) {} void Run(TestShell* shell) { wstring url = L"javascript:" + UTF8ToWide(script_); shell->LoadURL(url.c_str()); @@ -663,7 +663,6 @@ void LayoutTestController::dumpSelectionRect( void LayoutTestController::display( const CppArgumentList& args, CppVariant* result) { - shell_->webViewHost()->DisplayForRepaint(); result->SetNull(); } diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index 1fed2f9..fd95535 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -143,14 +143,10 @@ void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { } void WebWidgetHost::Paint() { - PaintToCanvas(); - PaintCanvasToView(); -} - -void WebWidgetHost::PaintToCanvas() { NSRect r = [view_ frame]; gfx::Rect client_rect(NSRectToCGRect(r)); NSGraphicsContext* view_context = [NSGraphicsContext currentContext]; + CGContextRef context = static_cast<CGContextRef>([view_context graphicsPort]); // Allocate a canvas if necessary if (!canvas_.get()) { @@ -195,45 +191,21 @@ void WebWidgetHost::PaintToCanvas() { // set the context back to our window [NSGraphicsContext setCurrentContext: view_context]; -} -void WebWidgetHost::PaintCanvasToView() { // Paint to the screen if ([view_ lockFocusIfCanDraw]) { - NSGraphicsContext* view_context = [NSGraphicsContext currentContext]; - NSRect r = [view_ frame]; - CGContextRef bitmap_context = - canvas_->getTopPlatformDevice().GetBitmapContext(); - CGContextRef context = - static_cast<CGContextRef>([view_context graphicsPort]); CGRect paint_rect = NSRectToCGRect(r); int bitmap_height = CGBitmapContextGetHeight(bitmap_context); int bitmap_width = CGBitmapContextGetWidth(bitmap_context); CGRect bitmap_rect = { { 0, 0 }, { bitmap_width, bitmap_height } }; canvas_->getTopPlatformDevice().DrawToContext( - context, 0, r.size.height - bitmap_height, &bitmap_rect); + context, 0, client_rect.height() - bitmap_height, &bitmap_rect); [view_ unlockFocus]; } } -void WebWidgetHost::DisplayForRepaint() { - PaintToCanvas(); - - // Paint a gray mask over everything for the repaint Layout tests. - CGContextRef bitmap_context = - canvas_->getTopPlatformDevice().GetBitmapContext(); - CGRect bitmap_rect = { { 0, 0 }, - { CGBitmapContextGetWidth(bitmap_context), - CGBitmapContextGetHeight(bitmap_context) } }; - CGContextSetBlendMode(bitmap_context, kCGBlendModeNormal); - CGContextSetRGBFillColor(bitmap_context, 0, 0, 0, 0.66); - CGContextFillRect(bitmap_context, bitmap_rect); - - PaintCanvasToView(); -} - void WebWidgetHost::Resize(const gfx::Rect& rect) { // Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer. DiscardBackingStore(); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 47afbb4..3dc08bb 100755 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -29,7 +29,7 @@ #include "net/base/mime_util.h" #include "net/url_request/url_request_file_job.h" #include "net/url_request/url_request_filter.h" -#include "skia/ext/platform_device.h" +#include "skia/ext/bitmap_platform_device.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/screen_info.h" #include "webkit/glue/webdatasource.h" @@ -227,8 +227,7 @@ void TestShell::Dump(TestShell* shell) { // command line (for the dump pixels argument), and the MD5 sum to // stdout. dumped_anything = true; - std::string md5sum = DumpImage(shell->webViewHost(), - params->pixel_file_name); + std::string md5sum = DumpImage(webFrame, params->pixel_file_name); printf("#MD5:%s\n", md5sum.c_str()); } if (dumped_anything) @@ -238,20 +237,13 @@ void TestShell::Dump(TestShell* shell) { } // static -std::string TestShell::DumpImage(WebViewHost* web_view_host, +std::string TestShell::DumpImage(WebFrame* web_frame, const std::wstring& file_name) { - web_view_host->Paint(); - skia::PlatformDevice& device = - web_view_host->canvas()->getTopPlatformDevice(); + scoped_ptr<skia::BitmapPlatformDevice> device; + if (!web_frame->CaptureImage(&device, true)) + return std::string(); -#if defined(OS_WIN) - // Make a copy, since we will have to fix the opacity. - const SkBitmap& orig = device.accessBitmap(false); - SkBitmap src_bmp; - orig.copyTo(&src_bmp, orig.config()); -#else - const SkBitmap& src_bmp = device.accessBitmap(false); -#endif + const SkBitmap& src_bmp = device->accessBitmap(false); // Encode image. std::vector<unsigned char> png; @@ -265,12 +257,7 @@ std::string TestShell::DumpImage(WebViewHost* web_view_host, // doesn't have the wrong alpha like Windows, but we ignore it anyway. #if defined(OS_WIN) bool discard_transparency = true; - // TODO(eroman): Clean this up. This used to be device.makeOpaque(), but I - // inlined it when resolving conflicts. - uint32_t* data = static_cast<uint32_t*> (src_bmp.getPixels()); - for (int i = 0; i < src_bmp.width() * src_bmp.height(); ++i) { - *(data + i) |= (0xFF << SK_A32_SHIFT); - } + device->makeOpaque(0, 0, src_bmp.width(), src_bmp.height()); #elif defined(OS_LINUX) bool discard_transparency = true; #elif defined(OS_MACOSX) diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index 7366900..0777ae0 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -209,9 +209,9 @@ public: // the flags set. static void Dump(TestShell* shell); - // Writes the image captured from the given web view to the given file. + // Writes the image captured from the given web frame to the given file. // The returned string is the ASCII-ized MD5 sum of the image. - static std::string DumpImage(WebViewHost* web_view_host, + static std::string DumpImage(WebFrame* web_frame, const std::wstring& file_name); static void ResetWebPreferences(); diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index ca32948..216c0b1 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -46,19 +46,7 @@ class WebWidgetHost { void UpdatePaintRect(const gfx::Rect& rect); void Paint(); - // Get the backing store. - skia::PlatformCanvas* canvas() const { return canvas_.get(); } - - // Paint() the widget, and cover it with a gray mask (black with a=0.66). - void DisplayForRepaint(); - protected: - // Paint the widget into canvas_. - void PaintToCanvas(); - - // Blit |canvas_| to |view_|. - void PaintCanvasToView(); - WebWidgetHost(); ~WebWidgetHost(); diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index e12b7c3..57d88d8 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -285,11 +285,6 @@ void WebWidgetHost::Resize(const gfx::Size &newsize) { } void WebWidgetHost::Paint() { - PaintToCanvas(); - PaintCanvasToView(); -} - -void WebWidgetHost::PaintToCanvas() { int width = view_->allocation.width; int height = view_->allocation.height; gfx::Rect client_rect(width, height); @@ -328,17 +323,14 @@ void WebWidgetHost::PaintToCanvas() { } DCHECK(paint_rect_.IsEmpty()); -} - -void WebWidgetHost::PaintCanvasToView() { // Invalidate the paint region on the widget's underlying gdk window. Note // that gdk_window_invalidate_* will generate extra expose events, which // we wish to avoid. So instead we use calls to begin_paint/end_paint. GdkRectangle grect = { - 0, - 0, - canvas_->getDevice()->width(), - canvas_->getDevice()->height(), + total_paint.x(), + total_paint.y(), + total_paint.width(), + total_paint.height(), }; GdkWindow* window = view_->window; gdk_window_begin_paint_rect(window, &grect); @@ -355,16 +347,6 @@ void WebWidgetHost::PaintCanvasToView() { gdk_window_end_paint(window); } -void WebWidgetHost::DisplayForRepaint() { - PaintToCanvas(); - - // Paint a gray mask over everything for the repaint Layout tests. - const SkColor kMaskColor = SkColorSetARGB(168, 0, 0, 0); // alpha=0.66 - canvas_->drawColor(kMaskColor, SkPorterDuff::kSrcOver_Mode); - - PaintCanvasToView(); -} - void WebWidgetHost::ResetScrollRect() { // This method is only needed for optimized scroll painting, which we don't // care about in the test shell, yet. diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index a8b561c..fc4be75 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -210,11 +210,6 @@ void WebWidgetHost::UpdatePaintRect(const gfx::Rect& rect) { } void WebWidgetHost::Paint() { - PaintToCanvas(); - PaintCanvasToView(); -} - -void WebWidgetHost::PaintToCanvas() { RECT r; GetClientRect(view_, &r); gfx::Rect client_rect(r); @@ -256,9 +251,8 @@ void WebWidgetHost::PaintToCanvas() { } } DCHECK(paint_rect_.IsEmpty()); -} -void WebWidgetHost::PaintCanvasToView() { + // Paint to the screen PAINTSTRUCT ps; BeginPaint(view_, &ps); canvas_->getTopPlatformDevice().drawToHDC(ps.hdc, @@ -271,16 +265,6 @@ void WebWidgetHost::PaintCanvasToView() { UpdateWindow(view_); } -void WebWidgetHost::DisplayForRepaint() { - PaintToCanvas(); - - // Paint a gray mask over everything for the repaint Layout tests. - const SkColor kMaskColor = SkColorSetARGB(168, 0, 0, 0); // alpha=0.66 - canvas_->drawColor(kMaskColor, SkPorterDuff::kSrcOver_Mode); - - PaintCanvasToView(); -} - void WebWidgetHost::Resize(LPARAM lparam) { // Force an entire re-paint. TODO(darin): Maybe reuse this memory buffer. DiscardBackingStore(); @@ -299,9 +283,9 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) { break; case WebInputEvent::MOUSE_DOWN: SetCapture(view_); - // This mimics a temporary workaround in RenderWidgetHostViewWin - // for bug 765011 to get focus when the mouse is clicked. This - // happens after the mouse down event is sent to the renderer + // This mimics a temporary workaround in RenderWidgetHostViewWin + // for bug 765011 to get focus when the mouse is clicked. This + // happens after the mouse down event is sent to the renderer // because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN. ::SetFocus(view_); break; |