summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 21:27:21 +0000
committerdglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 21:27:21 +0000
commit5bce9d2d662d026fe8cfc8cc6fa28ea52635ceee (patch)
tree3bf4921266baa4f0e804d0167b3d833db2645b17
parent1997e46947f75f6aeb713bb82adddc556b7ce71d (diff)
downloadchromium_src-5bce9d2d662d026fe8cfc8cc6fa28ea52635ceee.zip
chromium_src-5bce9d2d662d026fe8cfc8cc6fa28ea52635ceee.tar.gz
chromium_src-5bce9d2d662d026fe8cfc8cc6fa28ea52635ceee.tar.bz2
Implement testRepaint and sweepHorizontally methods on layoutTestController.
This involves implementing row-at-a-time and line-at-a-time repainting of the backing store. R=darin BUG=21510 TEST=LayoutTests/fast/repaint/shadow-multiple* Review URL: http://codereview.chromium.org/397027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32401 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt6
-rw-r--r--webkit/tools/test_shell/layout_test_controller.cc6
-rw-r--r--webkit/tools/test_shell/layout_test_controller.h10
-rw-r--r--webkit/tools/test_shell/test_shell.cc19
-rw-r--r--webkit/tools/test_shell/webwidget_host.h3
5 files changed, 41 insertions, 3 deletions
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index a4fbe90..5909faf 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -594,6 +594,11 @@ BUG21510 WIN LINUX : LayoutTests/fast/repaint/shadow-multiple-vertical.html = FA
BUG21510 WIN LINUX : LayoutTests/fast/repaint/text-shadow-horizontal.html = FAIL
BUG21510 WIN LINUX : LayoutTests/fast/repaint/text-shadow.html = FAIL
+// To be rebaselined. These were accidentally wall-papered over.
+BUG21510 : LayoutTests/fast/repaint/box-shadow-v.html = IMAGE
+BUG21510 LINUX : LayoutTests/fast/repaint/flexible-box-overflow-horizontal.html = IMAGE
+BUG21510 WIN LINUX : LayoutTests/fast/repaint/list-marker.html = IMAGE
+
// Implement layoutTestController.display()
BUG8630 WIN LINUX : LayoutTests/fast/repaint/body-background-image.html = FAIL
BUG8630 WIN LINUX DEBUG SLOW : LayoutTests/fast/repaint/line-flow-with-floats-1.html = PASS
@@ -2148,7 +2153,6 @@ BUG23475 MAC : LayoutTests/svg/custom/junk-data.svg = IMAGE
// 116/136 of the repaint tests fail due to invalidation that doesn't match; further triage necessary
BUG23473 MAC : LayoutTests/fast/repaint = IMAGE
-BUG23473 MAC : LayoutTests/fast/repaint/box-shadow-v.html = PASS
BUG23473 MAC : LayoutTests/fast/repaint/flexible-box-overflow.html = PASS
BUG23473 MAC : LayoutTests/fast/repaint/focus-layers.html = PASS
BUG23473 MAC : LayoutTests/fast/repaint/focus-ring.html = PASS
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc
index 86d4137..ecd92bb 100644
--- a/webkit/tools/test_shell/layout_test_controller.cc
+++ b/webkit/tools/test_shell/layout_test_controller.cc
@@ -53,6 +53,8 @@ bool LayoutTestController::accepts_editing_ = true;
bool LayoutTestController::wait_until_done_ = false;
bool LayoutTestController::can_open_windows_ = false;
bool LayoutTestController::close_remaining_windows_ = true;
+bool LayoutTestController::test_repaint_ = false;
+bool LayoutTestController::sweep_horizontally_ = false;
bool LayoutTestController::should_add_file_to_pasteboard_ = false;
bool LayoutTestController::stop_provisional_frame_loads_ = false;
LayoutTestController::WorkQueue LayoutTestController::work_queue_;
@@ -438,6 +440,8 @@ void LayoutTestController::Reset() {
accepts_editing_ = true;
wait_until_done_ = false;
can_open_windows_ = false;
+ test_repaint_ = false;
+ sweep_horizontally_ = false;
should_add_file_to_pasteboard_ = false;
stop_provisional_frame_loads_ = false;
globalFlag_.Set(false);
@@ -777,11 +781,13 @@ void LayoutTestController::display(
void LayoutTestController::testRepaint(
const CppArgumentList& args, CppVariant* result) {
+ test_repaint_ = true;
result->SetNull();
}
void LayoutTestController::repaintSweepHorizontally(
const CppArgumentList& args, CppVariant* result) {
+ sweep_horizontally_ = true;
result->SetNull();
}
diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h
index 1ddb879..8f5eedd 100644
--- a/webkit/tools/test_shell/layout_test_controller.h
+++ b/webkit/tools/test_shell/layout_test_controller.h
@@ -239,6 +239,9 @@ class LayoutTestController : public CppBoundClass {
bool ShouldAddFileToPasteboard() { return should_add_file_to_pasteboard_; }
bool StopProvisionalFrameLoads() { return stop_provisional_frame_loads_; }
+ bool test_repaint() const { return test_repaint_; }
+ bool sweep_horizontally() const { return sweep_horizontally_; }
+
// Called by the webview delegate when the toplevel frame load is done.
void LocationChangeDone();
@@ -354,6 +357,13 @@ class LayoutTestController : public CppBoundClass {
// setCloseRemainingWindowsWhenComplete().
static bool close_remaining_windows_;
+ // If true, pixel dump will be produced as a series of 1px-tall, view-wide
+ // individual paints over the height of the view.
+ static bool test_repaint_;
+ // If true and test_repaint_ is true as well, pixel dump will be produced as
+ // a series of 1px-wide, view-tall paints across the width of the view.
+ static bool sweep_horizontally_;
+
// If true and a drag starts, adds a file to the drag&drop clipboard.
static bool should_add_file_to_pasteboard_;
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index aeca423..c67be152 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -247,7 +247,24 @@ void TestShell::Dump(TestShell* shell) {
dumped_anything = true;
WebViewHost* view_host = shell->webViewHost();
view_host->webview()->layout();
- view_host->Paint();
+ if (shell->layout_test_controller()->test_repaint()) {
+ WebSize view_size = view_host->webview()->size();
+ int width = view_size.width;
+ int height = view_size.height;
+ if (shell->layout_test_controller()->sweep_horizontally()) {
+ for (gfx::Rect column(0, 0, 1, height); column.x() < width;
+ column.Offset(1, 0)) {
+ view_host->PaintRect(column);
+ }
+ } else {
+ for (gfx::Rect line(0, 0, width, 1); line.y() < height;
+ line.Offset(0, 1)) {
+ view_host->PaintRect(line);
+ }
+ }
+ } else {
+ view_host->Paint();
+ }
std::string md5sum = DumpImage(view_host->canvas(),
params->pixel_file_name, params->pixel_hash);
printf("#MD5:%s\n", md5sum.c_str());
diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h
index b899f96..cf66ed8 100644
--- a/webkit/tools/test_shell/webwidget_host.h
+++ b/webkit/tools/test_shell/webwidget_host.h
@@ -67,6 +67,8 @@ class WebWidgetHost {
canvas()->drawARGB(167, 0, 0, 0);
}
+ void PaintRect(const gfx::Rect& rect);
+
protected:
WebWidgetHost();
~WebWidgetHost();
@@ -114,7 +116,6 @@ class WebWidgetHost {
#endif
void ResetScrollRect();
- void PaintRect(const gfx::Rect& rect);
void set_painting(bool value) {
#ifndef NDEBUG