summaryrefslogtreecommitdiffstats
path: root/webkit/support
diff options
context:
space:
mode:
authortkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 08:13:27 +0000
committertkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 08:13:27 +0000
commitdb4791c48136f73181a337e4469578e2e45dba60 (patch)
treee6259ecc0ce114f7a5dfa17db710cb8632e46a93 /webkit/support
parent558847a19c803cb3b255d0d9812837a564f51cf3 (diff)
downloadchromium_src-db4791c48136f73181a337e4469578e2e45dba60.zip
chromium_src-db4791c48136f73181a337e4469578e2e45dba60.tar.gz
chromium_src-db4791c48136f73181a337e4469578e2e45dba60.tar.bz2
Some small changes to webkit_support.
* Add SetAcceptAllCookies(bool) It will be used by LayoutTestController. * Support the media library initialization with Mac bundles * Change the initialization order of MessageLoopForUI and TestWebKitClient This is important for appcache. TEST=none, this is a part of test code BUG=none Review URL: http://codereview.chromium.org/1212004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r--webkit/support/test_webkit_client.cc18
-rw-r--r--webkit/support/webkit_support.cc9
-rw-r--r--webkit/support/webkit_support.h1
3 files changed, 24 insertions, 4 deletions
diff --git a/webkit/support/test_webkit_client.cc b/webkit/support/test_webkit_client.cc
index 7f41c07..7f0eed2 100644
--- a/webkit/support/test_webkit_client.cc
+++ b/webkit/support/test_webkit_client.cc
@@ -44,6 +44,9 @@
#include "third_party/WebKit/WebKit/chromium/public/win/WebThemeEngine.h"
#include "webkit/tools/test_shell/test_shell_webthemeengine.h"
#endif
+#if defined(OS_MACOSX)
+#include "base/mac_util.h"
+#endif
using WebKit::WebScriptController;
@@ -66,10 +69,19 @@ TestWebKitClient::TestWebKitClient() {
WebKit::WebRuntimeFeatures::enableDatabase(true);
// Load libraries for media and enable the media player.
+ bool enable_media = false;
FilePath module_path;
- WebKit::WebRuntimeFeatures::enableMediaPlayer(
- PathService::Get(base::DIR_MODULE, &module_path) &&
- media::InitializeMediaLibrary(module_path));
+ if (PathService::Get(base::DIR_MODULE, &module_path)) {
+#if defined(OS_MACOSX)
+ if (mac_util::AmIBundled())
+ module_path = module_path.DirName().DirName().DirName();
+#endif
+ if (media::InitializeMediaLibrary(module_path))
+ enable_media = true;
+ }
+ WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media);
+ LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n";
+
// TODO(joth): Make a dummy geolocation service implemenation for
// test_shell, and set this to true. http://crbug.com/36451
WebKit::WebRuntimeFeatures::enableGeolocation(false);
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 0918b28..5c599e0 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -42,8 +42,9 @@ class TestEnvironment {
private:
base::AtExitManager at_exit_manager_;
- TestWebKitClient webkit_client_;
MessageLoopForUI main_message_loop_;
+ // TestWebKitClient must be instantiated after the MessageLoopForUI.
+ TestWebKitClient webkit_client_;
};
class WebPluginImplWithPageDelegate
@@ -130,4 +131,10 @@ void ClearAllDatabases() {
SimpleDatabaseSystem::GetInstance()->ClearAllDatabases();
}
+// Bridge for SimpleResourceLoaderBridge
+
+void SetAcceptAllCookies(bool accept) {
+ SimpleResourceLoaderBridge::SetAcceptAllCookies(accept);
+}
+
} // namespace webkit_support
diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h
index 651bb5c..a6af463 100644
--- a/webkit/support/webkit_support.h
+++ b/webkit/support/webkit_support.h
@@ -41,6 +41,7 @@ WebKit::WebMediaPlayer* CreateMediaPlayer(WebKit::WebFrame* frame,
// The following functions are used by LayoutTestController.
void SetDatabaseQuota(int quota);
void ClearAllDatabases();
+void SetAcceptAllCookies(bool accept);
} // namespace webkit_support