diff options
author | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 14:50:51 +0000 |
---|---|---|
committer | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 14:50:51 +0000 |
commit | 5a9d4ed6f85d345926f6e318f51ab6396124468f (patch) | |
tree | 2106dab8aa562771605c79d9623bc7df3ca9880f | |
parent | 5cdeb23956072025ff4bc3af2a2ab37896a0822f (diff) | |
download | chromium_src-5a9d4ed6f85d345926f6e318f51ab6396124468f.zip chromium_src-5a9d4ed6f85d345926f6e318f51ab6396124468f.tar.gz chromium_src-5a9d4ed6f85d345926f6e318f51ab6396124468f.tar.bz2 |
Switch to renamed method of SecurityPolicy and expose newly added method to layout_test_controller.
http://trac.webkit.org/changeset/57535 renamed SecurityOrigin::whiteListAccessFromOrigin to
addOriginAccessWhitelistEntry.
http://trac.webkit.org/changeset/57537 added SecurityOrigin::removeOriginAccessWhitelistEntry
Review URL: http://codereview.chromium.org/1742020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46346 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 28 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.h | 7 |
2 files changed, 30 insertions, 5 deletions
diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index bcc70fb..67cb0dd 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -128,7 +128,10 @@ LayoutTestController::LayoutTestController(TestShell* shell) : BindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader); BindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect); BindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull); - BindMethod("whiteListAccessFromOrigin", &LayoutTestController::whiteListAccessFromOrigin); + BindMethod("addOriginAccessWhitelistEntry", + &LayoutTestController::addOriginAccessWhitelistEntry); + BindMethod("removeOriginAccessWhitelistEntry", + &LayoutTestController::removeOriginAccessWhitelistEntry); BindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases); BindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota); BindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); @@ -1104,7 +1107,7 @@ void LayoutTestController::fallbackMethod( result->SetNull(); } -void LayoutTestController::whiteListAccessFromOrigin( +void LayoutTestController::addOriginAccessWhitelistEntry( const CppArgumentList& args, CppVariant* result) { result->SetNull(); @@ -1116,7 +1119,26 @@ void LayoutTestController::whiteListAccessFromOrigin( if (!url.isValid()) return; - WebSecurityPolicy::whiteListAccessFromOrigin(url, + WebSecurityPolicy::addOriginAccessWhitelistEntry(url, + WebString::fromUTF8(args[1].ToString()), + WebString::fromUTF8(args[2].ToString()), + args[3].ToBoolean()); +} + +void LayoutTestController::removeOriginAccessWhitelistEntry( + const CppArgumentList& args, CppVariant* result) +{ + result->SetNull(); + + if (args.size() != 4 || !args[0].isString() || !args[1].isString() || + !args[2].isString() || !args[3].isBool()) + return; + + WebKit::WebURL url(GURL(args[0].ToString())); + if (!url.isValid()) + return; + + WebSecurityPolicy::removeOriginAccessWhitelistEntry(url, WebString::fromUTF8(args[1].ToString()), WebString::fromUTF8(args[2].ToString()), args[3].ToBoolean()); diff --git a/webkit/tools/test_shell/layout_test_controller.h b/webkit/tools/test_shell/layout_test_controller.h index 0dc04df..4c614ab 100644 --- a/webkit/tools/test_shell/layout_test_controller.h +++ b/webkit/tools/test_shell/layout_test_controller.h @@ -227,8 +227,11 @@ class LayoutTestController : public CppBoundClass { // that case (as the Mac does). void fallbackMethod(const CppArgumentList& args, CppVariant* result); - // Allows layout tests to call SecurityOrigin::whiteListAccessFromOrigin(). - void whiteListAccessFromOrigin(const CppArgumentList& args, CppVariant* result); + // Allows layout tests to manage origins' whitelisting. + void addOriginAccessWhitelistEntry( + const CppArgumentList& args, CppVariant* result); + void removeOriginAccessWhitelistEntry( + const CppArgumentList& args, CppVariant* result); // Clears all databases. void clearAllDatabases(const CppArgumentList& args, CppVariant* result); |