diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:52:31 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:52:31 +0000 |
commit | 1683e11834b15dbd4e0e8161a9ed036d78a8d4d7 (patch) | |
tree | 46656018654203b8ecd8fd0f17f2bac1f5ef6128 /webkit/tools | |
parent | 90d7f142d5953caa72855290ad1672e1f5e84794 (diff) | |
download | chromium_src-1683e11834b15dbd4e0e8161a9ed036d78a8d4d7.zip chromium_src-1683e11834b15dbd4e0e8161a9ed036d78a8d4d7.tar.gz chromium_src-1683e11834b15dbd4e0e8161a9ed036d78a8d4d7.tar.bz2 |
Adds callShouldCloseOnWebView to TestShell's LayoutTestController.
Useful for the onbefore-unload-focused-iframe.html layout test.
BUG=39485
TEST=onbeforeunload-focused-iframe.html
Review URL: http://codereview.chromium.org/1527003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 6f91aaa..2f3fa75 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -147,6 +147,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) : BindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject); BindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf); BindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL); + BindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView); BindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews); BindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled); BindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode); @@ -809,6 +810,12 @@ void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList& args, result->SetNull(); } +void LayoutTestController::callShouldCloseOnWebView( + const CppArgumentList& args, CppVariant* result) { + bool rv = shell_->webView()->dispatchBeforeUnloadEvent(); + result->Set(rv); +} + // // Unimplemented stubs // diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 7e88d80..01ea79b 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -200,6 +200,7 @@ class LayoutTestController : public CppBoundClass { void accessStoredWebScriptObject(const CppArgumentList& args, CppVariant* result); void objCClassNameOf(const CppArgumentList& args, CppVariant* result); void addDisallowedURL(const CppArgumentList& args, CppVariant* result); + void callShouldCloseOnWebView(const CppArgumentList& args, CppVariant* result); void setCallCloseOnWebViews(const CppArgumentList& args, CppVariant* result); void setPrivateBrowsingEnabled(const CppArgumentList& args, CppVariant* result); |