diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 21:51:19 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 21:51:19 +0000 |
commit | 893f1c4cbefe27f54770f5f71f8014cbe13e6011 (patch) | |
tree | ae5f2b37a6370030ca5acc50e9e50ab5f5a3e305 /webkit | |
parent | 8c9510d637c87ab81937b8f1eb8ee9821c5be94a (diff) | |
download | chromium_src-893f1c4cbefe27f54770f5f71f8014cbe13e6011.zip chromium_src-893f1c4cbefe27f54770f5f71f8014cbe13e6011.tar.gz chromium_src-893f1c4cbefe27f54770f5f71f8014cbe13e6011.tar.bz2 |
Implement layoutTestController.setPopupBlockingEnabled. This
gives us one more passing test.
Review URL: http://codereview.chromium.org/7241
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 13 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 5 |
3 files changed, 17 insertions, 5 deletions
diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index dd342a6..15ce3a3 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -319,10 +319,6 @@ KJS # LayoutTests/fast/dom/Window/new-window-opener.html = FAIL // We don't support support window.resizeTo (nor is it planned for Beta) V8 | KJS # LayoutTests/fast/dom/Window/window-resize-and-move-arguments.html = FAIL -// layoutTestController.setPopupBlockingEnabled() does not exist. -// Not critical for Beta. -V8 | KJS # LayoutTests/fast/events/open-window-from-another-frame.html = FAIL - // Test expects that when focus is in an iframe and page-up is hit, the parent // document is also scrolled // IE and FF also "fail" this test. diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 68f32be..8991693 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -91,6 +91,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) { BindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource); BindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag); BindMethod("execCommand", &LayoutTestController::execCommand); + BindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); // The following are stubs. BindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive); @@ -454,6 +455,18 @@ void LayoutTestController::execCommand( result->SetNull(); } +void LayoutTestController::setPopupBlockingEnabled( + const CppArgumentList& args, CppVariant* result) { + if (args.size() > 0 && args[0].isBool()) { + bool block_popups = args[0].ToBoolean(); + WebPreferences* prefs = shell_->GetWebPreferences(); + prefs->javascript_can_open_windows_automatically = !block_popups; + + shell_->webView()->SetPreferences(*prefs); + } + result->SetNull(); +} + void LayoutTestController::setUseDashboardCompatibilityMode( const CppArgumentList& args, CppVariant* result) { // We have no need to support Dashboard Compatibility Mode (mac-only) diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 109346b..53f3995 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -111,7 +111,10 @@ class LayoutTestController : public CppBoundClass { void addFileToPasteboardOnDrag(const CppArgumentList& args, CppVariant* result); // Executes an internal command (superset of document.execCommand() commands) - void execCommand(const CppArgumentList& args, CppVariant* result);; + void execCommand(const CppArgumentList& args, CppVariant* result); + + // Set the WebPreference that controls webkit's popup blocking. + void setPopupBlockingEnabled(const CppArgumentList& args, CppVariant* result); // The following are only stubs. TODO(pamg): Implement any of these that // are needed to pass the layout tests. |