| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/test/test_blink_web_unit_test_support.h" | 5 #include "content/test/test_blink_web_unit_test_support.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 blink::WebString::fromUTF8("test-shell-resource")); | 150 blink::WebString::fromUTF8("test-shell-resource")); |
| 151 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( | 151 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( |
| 152 blink::WebString::fromUTF8("test-shell-resource")); | 152 blink::WebString::fromUTF8("test-shell-resource")); |
| 153 blink::WebSecurityPolicy::registerURLSchemeAsEmptyDocument( | 153 blink::WebSecurityPolicy::registerURLSchemeAsEmptyDocument( |
| 154 blink::WebString::fromUTF8("test-shell-resource")); | 154 blink::WebString::fromUTF8("test-shell-resource")); |
| 155 blink::WebRuntimeFeatures::enableApplicationCache(true); | 155 blink::WebRuntimeFeatures::enableApplicationCache(true); |
| 156 blink::WebRuntimeFeatures::enableDatabase(true); | 156 blink::WebRuntimeFeatures::enableDatabase(true); |
| 157 blink::WebRuntimeFeatures::enableNotifications(true); | 157 blink::WebRuntimeFeatures::enableNotifications(true); |
| 158 blink::WebRuntimeFeatures::enableTouch(true); | 158 blink::WebRuntimeFeatures::enableTouch(true); |
| 159 | 159 |
| 160 // Load libraries for media and enable the media player. | 160 // Initialize libraries for media and enable the media player. |
| 161 bool enable_media = false; | 161 media::InitializeMediaLibrary(); |
| 162 base::FilePath module_path; | 162 blink::WebRuntimeFeatures::enableMediaPlayer(true); |
| 163 if (PathService::Get(base::DIR_MODULE, &module_path)) { | |
| 164 #if defined(OS_MACOSX) | |
| 165 if (base::mac::AmIBundled()) | |
| 166 module_path = module_path.DirName().DirName().DirName(); | |
| 167 #endif | |
| 168 if (media::InitializeMediaLibrary(module_path)) | |
| 169 enable_media = true; | |
| 170 } | |
| 171 blink::WebRuntimeFeatures::enableMediaPlayer(enable_media); | |
| 172 LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; | |
| 173 | 163 |
| 174 file_utilities_.set_sandbox_enabled(false); | 164 file_utilities_.set_sandbox_enabled(false); |
| 175 | 165 |
| 176 if (!file_system_root_.CreateUniqueTempDir()) { | 166 if (!file_system_root_.CreateUniqueTempDir()) { |
| 177 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 167 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
| 178 "FileSystem feature will be disabled."; | 168 "FileSystem feature will be disabled."; |
| 179 DCHECK(file_system_root_.path().empty()); | 169 DCHECK(file_system_root_.path().empty()); |
| 180 } | 170 } |
| 181 | 171 |
| 182 #if defined(OS_WIN) | 172 #if defined(OS_WIN) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 DCHECK(base::MessageLoop::current()); | 394 DCHECK(base::MessageLoop::current()); |
| 405 DCHECK(!base::MessageLoop::current()->is_running()); | 395 DCHECK(!base::MessageLoop::current()->is_running()); |
| 406 base::MessageLoop::current()->Run(); | 396 base::MessageLoop::current()->Run(); |
| 407 } | 397 } |
| 408 | 398 |
| 409 void TestBlinkWebUnitTestSupport::exitRunLoop() { | 399 void TestBlinkWebUnitTestSupport::exitRunLoop() { |
| 410 base::MessageLoop::current()->Quit(); | 400 base::MessageLoop::current()->Quit(); |
| 411 } | 401 } |
| 412 | 402 |
| 413 } // namespace content | 403 } // namespace content |
| OLD | NEW |