From ecc8defbf718fc408c880fc984fa04552c45736b Mon Sep 17 00:00:00 2001 From: "jorlow@chromium.org" Date: Wed, 19 Aug 2009 02:13:14 +0000 Subject: The 2 layout test regressions happened due to changes in the test shell. After looking at the diff, I realized that I had changed the behavior more than necessary. So I've reverted back the parts that were using the web settings API directly and now they're setting properties on their web preferences object and then just applying that to the web view. This should match the behavior of before. This is fixing some behavior committed in http://src.chromium.org/viewvc/chrome?view=rev&revision=23589 TEST=none BUG=19544 Review URL: http://codereview.chromium.org/171097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23684 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/tools/layout_tests/test_expectations.txt | 5 +---- webkit/tools/test_shell/layout_test_controller.cc | 15 +++++++++------ webkit/tools/test_shell/test_webview_delegate.cc | 15 +++++++-------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index e17c319..f9737dc 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -2789,9 +2789,6 @@ BUG19409 WIN : LayoutTests/media/video-empty-source.html = PASS TIMEOUT BUG19519 MAC DEBUG : LayoutTests/fast/css/last-of-type-pseudo-class.html = FAIL PASS -BUG19544 : LayoutTests/http/tests/security/xssAuditor/link-opens-new-window.html = FAIL -BUG19544 : LayoutTests/fast/loader/user-style-sheet-resource-load-callbacks.html = FAIL - // Fallout from webkit 47305:47383 BUG19655 : LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html = FAIL BUG19655 : LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html = FAIL @@ -2815,4 +2812,4 @@ BUG19640 WIN : LayoutTests/platform/win/accessibility/focus-events.html = FAIL // Code was checked into webkit without expectations in 47329, added in 47437. // Remove this once we roll deps that far -BUG_JPARENT SKIP : LayoutTests/fast/wml/html-fieldset-crash.html = FAIL \ No newline at end of file +BUG_JPARENT SKIP : LayoutTests/fast/wml/html-fieldset-crash.html = FAIL diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index ffe1e3e..fe09e99 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -16,7 +16,6 @@ #include "base/string_util.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebScriptSource.h" -#include "webkit/api/public/WebSettings.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webview.h" @@ -557,8 +556,9 @@ void LayoutTestController::setPopupBlockingEnabled( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isBool()) { bool block_popups = args[0].ToBoolean(); - shell_->webView()->GetSettings()->setJavaScriptCanOpenWindowsAutomatically( - !block_popups); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->javascript_can_open_windows_automatically = !block_popups; + prefs->Apply(shell_->webView()); } result->SetNull(); } @@ -705,7 +705,9 @@ void LayoutTestController::numberOfActiveAnimations(const CppArgumentList& args, void LayoutTestController::disableImageLoading(const CppArgumentList& args, CppVariant* result) { - shell_->webView()->GetSettings()->setLoadsImagesAutomatically(false); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->loads_images_automatically = false; + prefs->Apply(shell_->webView()); result->SetNull(); } @@ -789,8 +791,9 @@ void LayoutTestController::setPrivateBrowsingEnabled( void LayoutTestController::setXSSAuditorEnabled( const CppArgumentList& args, CppVariant* result) { if (args.size() > 0 && args[0].isBool()) { - bool enabled = args[0].value.boolValue; - shell_->webView()->GetSettings()->setXSSAuditorEnabled(enabled); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->xss_auditor_enabled = args[0].value.boolValue; + prefs->Apply(shell_->webView()); } result->SetNull(); } diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 2836a5f..279949a 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -27,7 +27,6 @@ #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebKit.h" #include "webkit/api/public/WebScreenInfo.h" -#include "webkit/api/public/WebSettings.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLError.h" @@ -806,16 +805,16 @@ int TestWebViewDelegate::GetHistoryForwardListCount() { } void TestWebViewDelegate::SetUserStyleSheetEnabled(bool is_enabled) { - // Disabling/enabling this is really just setting it to an empty URL or - // setting it to something else. From this location in the code, there's - // no way to know what it's supposed to be. Luckily, right now, this is only - // used to disable the user style sheet. - DCHECK(!is_enabled); - shell_->webView()->GetSettings()->setUserStyleSheetLocation(WebURL()); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->user_style_sheet_enabled = is_enabled; + prefs->Apply(shell_->webView()); } void TestWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) { - shell_->webView()->GetSettings()->setUserStyleSheetLocation(location); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->user_style_sheet_enabled = true; + prefs->user_style_sheet_location = location; + prefs->Apply(shell_->webView()); } // WebWidgetDelegate --------------------------------------------------------- -- cgit v1.1