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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 blink::WebString::fromUTF8("test-shell-resource")); | 119 blink::WebString::fromUTF8("test-shell-resource")); |
120 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( | 120 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( |
121 blink::WebString::fromUTF8("test-shell-resource")); | 121 blink::WebString::fromUTF8("test-shell-resource")); |
122 blink::WebSecurityPolicy::registerURLSchemeAsEmptyDocument( | 122 blink::WebSecurityPolicy::registerURLSchemeAsEmptyDocument( |
123 blink::WebString::fromUTF8("test-shell-resource")); | 123 blink::WebString::fromUTF8("test-shell-resource")); |
124 blink::WebRuntimeFeatures::enableApplicationCache(true); | 124 blink::WebRuntimeFeatures::enableApplicationCache(true); |
125 blink::WebRuntimeFeatures::enableDatabase(true); | 125 blink::WebRuntimeFeatures::enableDatabase(true); |
126 blink::WebRuntimeFeatures::enableNotifications(true); | 126 blink::WebRuntimeFeatures::enableNotifications(true); |
127 blink::WebRuntimeFeatures::enableTouch(true); | 127 blink::WebRuntimeFeatures::enableTouch(true); |
128 | 128 |
129 // Load libraries for media and enable the media player. | 129 // Initialize libraries for media and enable the media player. |
130 bool enable_media = false; | 130 media::InitializeMediaLibrary(); |
131 base::FilePath module_path; | 131 blink::WebRuntimeFeatures::enableMediaPlayer(true); |
132 if (PathService::Get(base::DIR_MODULE, &module_path)) { | |
133 #if defined(OS_MACOSX) | |
134 if (base::mac::AmIBundled()) | |
135 module_path = module_path.DirName().DirName().DirName(); | |
136 #endif | |
137 if (media::InitializeMediaLibrary(module_path)) | |
138 enable_media = true; | |
139 } | |
140 blink::WebRuntimeFeatures::enableMediaPlayer(enable_media); | |
141 LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; | |
142 | 132 |
143 file_utilities_.set_sandbox_enabled(false); | 133 file_utilities_.set_sandbox_enabled(false); |
144 | 134 |
145 if (!file_system_root_.CreateUniqueTempDir()) { | 135 if (!file_system_root_.CreateUniqueTempDir()) { |
146 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 136 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
147 "FileSystem feature will be disabled."; | 137 "FileSystem feature will be disabled."; |
148 DCHECK(file_system_root_.path().empty()); | 138 DCHECK(file_system_root_.path().empty()); |
149 } | 139 } |
150 | 140 |
151 #if defined(OS_WIN) | 141 #if defined(OS_WIN) |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 DCHECK(base::MessageLoop::current()); | 363 DCHECK(base::MessageLoop::current()); |
374 DCHECK(!base::MessageLoop::current()->is_running()); | 364 DCHECK(!base::MessageLoop::current()->is_running()); |
375 base::MessageLoop::current()->Run(); | 365 base::MessageLoop::current()->Run(); |
376 } | 366 } |
377 | 367 |
378 void TestBlinkWebUnitTestSupport::exitRunLoop() { | 368 void TestBlinkWebUnitTestSupport::exitRunLoop() { |
379 base::MessageLoop::current()->Quit(); | 369 base::MessageLoop::current()->Quit(); |
380 } | 370 } |
381 | 371 |
382 } // namespace content | 372 } // namespace content |
OLD | NEW |