diff options
author | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 08:13:27 +0000 |
---|---|---|
committer | tkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 08:13:27 +0000 |
commit | db4791c48136f73181a337e4469578e2e45dba60 (patch) | |
tree | e6259ecc0ce114f7a5dfa17db710cb8632e46a93 /webkit/support/test_webkit_client.cc | |
parent | 558847a19c803cb3b255d0d9812837a564f51cf3 (diff) | |
download | chromium_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/test_webkit_client.cc')
-rw-r--r-- | webkit/support/test_webkit_client.cc | 18 |
1 files changed, 15 insertions, 3 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); |