diff options
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/simple_webcookiejar_impl.cc | 25 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_webcookiejar_impl.h | 22 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gypi | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_webkit_init.h | 26 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 14 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 1 |
6 files changed, 70 insertions, 20 deletions
diff --git a/webkit/tools/test_shell/simple_webcookiejar_impl.cc b/webkit/tools/test_shell/simple_webcookiejar_impl.cc new file mode 100644 index 0000000..e534beb --- /dev/null +++ b/webkit/tools/test_shell/simple_webcookiejar_impl.cc @@ -0,0 +1,25 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/tools/test_shell/simple_webcookiejar_impl.h" + +#include "third_party/WebKit/WebKit/chromium/public/WebURL.h" +#include "webkit/tools/test_shell/simple_resource_loader_bridge.h" + +using WebKit::WebString; +using WebKit::WebURL; + +void SimpleWebCookieJarImpl::setCookie(const WebURL& url, + const WebURL& first_party_for_cookies, + const WebString& value) { + SimpleResourceLoaderBridge::SetCookie( + url, first_party_for_cookies, value.utf8()); +} + +WebString SimpleWebCookieJarImpl::cookies( + const WebURL& url, + const WebURL& first_party_for_cookies) { + return WebString::fromUTF8( + SimpleResourceLoaderBridge::GetCookies(url, first_party_for_cookies)); +} diff --git a/webkit/tools/test_shell/simple_webcookiejar_impl.h b/webkit/tools/test_shell/simple_webcookiejar_impl.h new file mode 100644 index 0000000..fe53561 --- /dev/null +++ b/webkit/tools/test_shell/simple_webcookiejar_impl.h @@ -0,0 +1,22 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBCOOKIEJAR_IMPL_H_ +#define WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBCOOKIEJAR_IMPL_H_ + +// TODO(darin): WebCookieJar.h is missing a WebString.h include! +#include "third_party/WebKit/WebKit/chromium/public/WebString.h" +#include "third_party/WebKit/WebKit/chromium/public/WebCookieJar.h" + +class SimpleWebCookieJarImpl : public WebKit::WebCookieJar { + public: + // WebKit::WebCookieJar methods: + virtual void setCookie( + const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies, + const WebKit::WebString& cookie); + virtual WebKit::WebString cookies( + const WebKit::WebURL& url, const WebKit::WebURL& first_party_for_cookies); +}; + +#endif // WEBKIT_TOOLS_TEST_SHELL_SIMPLE_WEBCOOKIEJAR_IMPL_H_ diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index 4ad72ca..67bb736 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -83,6 +83,8 @@ 'simple_resource_loader_bridge.h', 'simple_socket_stream_bridge.cc', 'simple_socket_stream_bridge.h', + 'simple_webcookiejar_impl.h', + 'simple_webcookiejar_impl.cc', 'test_navigation_controller.cc', 'test_navigation_controller.h', 'test_shell.cc', diff --git a/webkit/tools/test_shell/test_shell_webkit_init.h b/webkit/tools/test_shell/test_shell_webkit_init.h index 4c59551..95608ae 100644 --- a/webkit/tools/test_shell/test_shell_webkit_init.h +++ b/webkit/tools/test_shell/test_shell_webkit_init.h @@ -1,6 +1,6 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ @@ -34,6 +34,7 @@ #include "webkit/tools/test_shell/simple_appcache_system.h" #include "webkit/tools/test_shell/simple_database_system.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" +#include "webkit/tools/test_shell/simple_webcookiejar_impl.h" #include "v8/include/v8.h" #if defined(OS_WIN) @@ -111,6 +112,10 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { return NULL; } + virtual WebKit::WebCookieJar* cookieJar() { + return &cookie_jar_; + } + virtual bool sandboxEnabled() { return true; } @@ -158,20 +163,6 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { return NULL; } - virtual void setCookies(const WebKit::WebURL& url, - const WebKit::WebURL& first_party_for_cookies, - const WebKit::WebString& value) { - SimpleResourceLoaderBridge::SetCookie( - url, first_party_for_cookies, value.utf8()); - } - - virtual WebKit::WebString cookies( - const WebKit::WebURL& url, - const WebKit::WebURL& first_party_for_cookies) { - return WebKit::WebString::fromUTF8(SimpleResourceLoaderBridge::GetCookies( - url, first_party_for_cookies)); - } - virtual void prefetchHostName(const WebKit::WebString&) { } @@ -238,6 +229,7 @@ class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { ScopedTempDir appcache_dir_; SimpleAppCacheSystem appcache_system_; SimpleDatabaseSystem database_system_; + SimpleWebCookieJarImpl cookie_jar_; #if defined(OS_WIN) WebKit::WebThemeEngine* active_theme_engine_; diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 4f0ed93..4c5db40 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -26,6 +26,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" +#include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" @@ -67,6 +68,7 @@ using appcache::WebApplicationCacheHostImpl; using WebKit::WebAccessibilityObject; using WebKit::WebConsoleMessage; using WebKit::WebContextMenuData; +using WebKit::WebCookieJar; using WebKit::WebData; using WebKit::WebDataSource; using WebKit::WebDragData; @@ -590,6 +592,11 @@ int TestWebViewDelegate::historyForwardListCount() { return shell_->navigation_controller()->GetEntryCount() - current_index - 1; } +void TestWebViewDelegate::focusAccessibilityObject( + const WebAccessibilityObject& object) { + shell_->accessibility_controller()->SetFocusedElement(object); +} + // WebWidgetClient ----------------------------------------------------------- void TestWebViewDelegate::didInvalidateRect(const WebRect& rect) { @@ -1013,9 +1020,10 @@ bool TestWebViewDelegate::allowScript(WebFrame* frame, return enabled_per_settings && shell_->allow_scripts(); } -void TestWebViewDelegate::focusAccessibilityObject( - const WebAccessibilityObject& object) { - shell_->accessibility_controller()->SetFocusedElement(object); +// WebPluginPageDelegate ----------------------------------------------------- + +WebCookieJar* TestWebViewDelegate::GetCookieJar() { + return WebKit::webKitClient()->cookieJar(); } // Public methods ------------------------------------------------------------ diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 305b2fa..4bd36f5 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -225,6 +225,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, const gfx::Size& size, const std::string& json_arguments, std::string* json_retval) {} + virtual WebKit::WebCookieJar* GetCookieJar(); TestWebViewDelegate(TestShell* shell); ~TestWebViewDelegate(); |