summaryrefslogtreecommitdiffstats
path: root/webkit/support
diff options
context:
space:
mode:
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