diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 22:07:22 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 22:07:22 +0000 |
commit | a7f1741893b9d6555c35afb8ff41f5750e05cbe8 (patch) | |
tree | 360824c2df9ea1a740bc367f821eacbfc6cd4f27 /content/shell | |
parent | 76c17933a3bd61803acb56747c799540869c15a9 (diff) | |
download | chromium_src-a7f1741893b9d6555c35afb8ff41f5750e05cbe8.zip chromium_src-a7f1741893b9d6555c35afb8ff41f5750e05cbe8.tar.gz chromium_src-a7f1741893b9d6555c35afb8ff41f5750e05cbe8.tar.bz2 |
[content shell] enable mock scrollbars for compositing layout tests
BUG=111316
R=tsepez@chromium.org,tony@chromium.org,jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11969043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/webkit_test_controller.cc | 23 | ||||
-rw-r--r-- | content/shell/webkit_test_controller.h | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc index ef4b5e63..596d6c7 100644 --- a/content/shell/webkit_test_controller.cc +++ b/content/shell/webkit_test_controller.cc @@ -165,6 +165,8 @@ bool WebKitTestController::PrepareForLayoutTest( content::ShellBrowserContext* browser_context = static_cast<content::ShellContentBrowserClient*>( content::GetContentClient()->browser())->browser_context(); + if (test_url.spec().find("compositing/") != std::string::npos) + is_compositing_test_ = true; gfx::Size initial_size; // The W3C SVG layout tests use a different size than the other layout tests. if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos) @@ -177,15 +179,12 @@ bool WebKitTestController::PrepareForLayoutTest( initial_size); WebContentsObserver::Observe(main_window_->web_contents()); main_window_->LoadURL(test_url); - if (test_url.spec().find("/dumpAsText/") != std::string::npos || - test_url.spec().find("\\dumpAsText\\") != std::string::npos) { + if (test_url.spec().find("/dumpAsText/") != std::string::npos) { dump_as_text_ = true; enable_pixel_dumping_ = false; } - if (test_url.spec().find("/inspector/") != std::string::npos || - test_url.spec().find("\\inspector\\") != std::string::npos) { + if (test_url.spec().find("/inspector/") != std::string::npos) main_window_->ShowDevTools(); - } main_window_->web_contents()->GetRenderViewHost()->Focus(); main_window_->web_contents()->GetRenderViewHost()->SetActive(true); return true; @@ -195,6 +194,7 @@ bool WebKitTestController::ResetAfterLayoutTest() { DCHECK(CalledOnValidThread()); printer_->PrintTextFooter(); printer_->PrintImageFooter(); + is_compositing_test_ = false; enable_pixel_dumping_ = false; expected_pixel_hash_.clear(); captured_dump_ = false; @@ -229,10 +229,19 @@ void WebKitTestController::RendererUnresponsive() { void WebKitTestController::OverrideWebkitPrefs( webkit_glue::WebPreferences* prefs) { - if (should_override_prefs_) + if (should_override_prefs_) { *prefs = prefs_; - else + } else { ApplyLayoutTestDefaultPreferences(prefs); + if (is_compositing_test_) { + CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kEnableSoftwareCompositing)) + prefs->accelerated_2d_canvas_enabled = true; + prefs->accelerated_compositing_for_video_enabled = true; + prefs->deferred_2d_canvas_enabled = true; + prefs->mock_scrollbars_enabled = true; + } + } } bool WebKitTestController::CanOpenWindows() const { diff --git a/content/shell/webkit_test_controller.h b/content/shell/webkit_test_controller.h index f8ce0e3..113b98f 100644 --- a/content/shell/webkit_test_controller.h +++ b/content/shell/webkit_test_controller.h @@ -147,6 +147,8 @@ class WebKitTestController : public base::NonThreadSafe, int current_pid_; + bool is_compositing_test_; + bool enable_pixel_dumping_; std::string expected_pixel_hash_; |