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

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: Always reset preferences 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..9aca502cd1995794db6989e01544b27220b6325b 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -278,8 +278,8 @@ bool BlinkTestController::PrepareForLayoutTest(
accumulated_layout_test_runtime_flags_changes_.Clear();
ShellBrowserContext* browser_context =
ShellContentBrowserClient::Get()->browser_context();
- if (test_url.spec().find("compositing/") != std::string::npos)
- is_compositing_test_ = true;
+ is_compositing_test_ =
+ test_url.spec().find("compositing/") != std::string::npos;
initial_size_ = Shell::GetShellDefaultSize();
// 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)
@@ -311,6 +311,13 @@ bool BlinkTestController::PrepareForLayoutTest(
->WasResized();
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
+
+ // Compositing tests override the default preferences (see
+ // BlinkTestController::OverrideWebkitPrefs) so we force them to be
+ // calculated again to ensure is_compositing_test_ changes are picked up.
+ default_prefs_ = render_view_host->GetWebkitPreferences();
+ OverrideWebkitPrefs(&default_prefs_);
+
render_view_host->UpdateWebkitPreferences(default_prefs_);
HandleNewRenderFrameHost(render_view_host->GetMainFrame());
« 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