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

Unified Diff: content/shell/browser/layout_test/blink_test_controller.cc

Issue 2208603004: Ensure compositing test preference overrides are reset between tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add windows-specific test expectations update Created 4 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 | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/layout_test/blink_test_controller.cc
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
index eb1a9139eaf109cf88ed84778ee8be2fcd8739ec..c78a5a5d8b66d03fa7c04524448bee7f734e7654 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -222,6 +222,7 @@ BlinkTestController* BlinkTestController::Get() {
BlinkTestController::BlinkTestController()
: main_window_(NULL),
test_phase_(BETWEEN_TESTS),
+ is_compositing_test_(false),
is_leak_detection_enabled_(
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableLeakDetection)),
@@ -311,6 +312,12 @@ bool BlinkTestController::PrepareForLayoutTest(
->WasResized();
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
+ if (is_compositing_test_) {
Xianzhu 2016/08/04 15:53:26 Can we just omit this condition, to ensure the pre
pdr. 2016/08/08 21:29:40 Good idea. I thought that might be too slow but fo
+ // Force the existing host to recompute default preferences and pickup
+ // compositing preference overrides.
+ render_view_host->OnWebkitPreferencesChanged();
+ default_prefs_ = render_view_host->GetWebkitPreferences();
+ }
render_view_host->UpdateWebkitPreferences(default_prefs_);
Xianzhu 2016/08/04 16:04:52 Would it work to just change the above call to the
HandleNewRenderFrameHost(render_view_host->GetMainFrame());
@@ -334,7 +341,14 @@ bool BlinkTestController::ResetAfterLayoutTest() {
printer_->CloseStderr();
did_send_initial_test_configuration_ = false;
test_phase_ = BETWEEN_TESTS;
- is_compositing_test_ = false;
+ if (is_compositing_test_) {
+ // Compositing tests change preferences so explicitly reset them.
+ ApplyLayoutTestDefaultPreferences(&default_prefs_);
+ RenderViewHost* render_view_host =
+ main_window_->web_contents()->GetRenderViewHost();
+ render_view_host->UpdateWebkitPreferences(default_prefs_);
+ is_compositing_test_ = false;
Xianzhu 2016/08/04 16:04:52 1. Is the above code necessary as we always update
+ }
enable_pixel_dumping_ = false;
expected_pixel_hash_.clear();
test_url_ = GURL();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698