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

Unified Diff: content/shell/webkit_test_runner.cc

Issue 11565036: [content shell] use WebTestRunner::WebPreferences for layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years 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
« content/shell/shell_webpreferences.h ('K') | « content/shell/webkit_test_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/webkit_test_runner.cc
diff --git a/content/shell/webkit_test_runner.cc b/content/shell/webkit_test_runner.cc
index 098afdf1a534b0fad25321f4567aecb601cd3fbf..a45e951624a20ba47a2bf2220e499be2d89cab30 100644
--- a/content/shell/webkit_test_runner.cc
+++ b/content/shell/webkit_test_runner.cc
@@ -47,6 +47,7 @@ using WebKit::WebSize;
using WebKit::WebString;
using WebKit::WebVector;
using WebKit::WebView;
+using WebTestRunner::WebPreferences;
using WebTestRunner::WebTask;
namespace content {
@@ -235,6 +236,17 @@ WebString WebKitTestRunner::getAbsoluteWebStringFromUTF8Path(
return webkit_base::FilePathToWebString(path);
}
+WebPreferences* WebKitTestRunner::preferences() {
+ return &prefs_;
+}
+
+void WebKitTestRunner::applyPreferences() {
+ webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
+ prefs_.Export(&prefs);
+ render_view()->SetWebkitPreferences(prefs);
+ Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs_));
+}
+
// RenderViewObserver --------------------------------------------------------
void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) {
@@ -276,9 +288,9 @@ void WebKitTestRunner::Display() {
}
void WebKitTestRunner::SetXSSAuditorEnabled(bool enabled) {
- prefs_.xss_auditor_enabled = enabled;
+ prefs_.XSSAuditorEnabled = enabled;
webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
- prefs_.Apply(&prefs);
+ prefs_.Export(&prefs);
render_view()->SetWebkitPreferences(prefs);
Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs_));
}
@@ -334,9 +346,9 @@ void WebKitTestRunner::NotImplemented(const std::string& object,
}
void WebKitTestRunner::Reset() {
- prefs_ = ShellWebPreferences();
+ prefs_.reset();
webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
- prefs_.Apply(&prefs);
+ prefs_.Export(&prefs);
render_view()->SetWebkitPreferences(prefs);
}
« content/shell/shell_webpreferences.h ('K') | « content/shell/webkit_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698