| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Initialize NetworkStateNotifier. | 129 // Initialize NetworkStateNotifier. |
| 130 blink::WebNetworkStateNotifier::setWebConnection( | 130 blink::WebNetworkStateNotifier::setWebConnection( |
| 131 blink::WebConnectionType::WebConnectionTypeUnknown, | 131 blink::WebConnectionType::WebConnectionTypeUnknown, |
| 132 std::numeric_limits<double>::infinity()); | 132 std::numeric_limits<double>::infinity()); |
| 133 | 133 |
| 134 // External cc::AnimationHost is enabled for unit tests. | |
| 135 cc::LayerSettings layer_settings; | |
| 136 layer_settings.use_compositor_animation_timelines = true; | |
| 137 cc_blink::WebLayerImpl::SetLayerSettings(layer_settings); | |
| 138 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); | |
| 139 | |
| 140 // Initialize libraries for media and enable the media player. | 134 // Initialize libraries for media and enable the media player. |
| 141 media::InitializeMediaLibrary(); | 135 media::InitializeMediaLibrary(); |
| 142 blink::WebRuntimeFeatures::enableMediaPlayer(true); | 136 blink::WebRuntimeFeatures::enableMediaPlayer(true); |
| 143 | 137 |
| 144 file_utilities_.set_sandbox_enabled(false); | 138 file_utilities_.set_sandbox_enabled(false); |
| 145 | 139 |
| 146 if (!file_system_root_.CreateUniqueTempDir()) { | 140 if (!file_system_root_.CreateUniqueTempDir()) { |
| 147 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 141 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
| 148 "FileSystem feature will be disabled."; | 142 "FileSystem feature will be disabled."; |
| 149 DCHECK(file_system_root_.path().empty()); | 143 DCHECK(file_system_root_.path().empty()); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return BlinkPlatformImpl::currentThread(); | 346 return BlinkPlatformImpl::currentThread(); |
| 353 } | 347 } |
| 354 | 348 |
| 355 void TestBlinkWebUnitTestSupport::getPluginList( | 349 void TestBlinkWebUnitTestSupport::getPluginList( |
| 356 bool refresh, blink::WebPluginListBuilder* builder) { | 350 bool refresh, blink::WebPluginListBuilder* builder) { |
| 357 builder->addPlugin("pdf", "pdf", "pdf-files"); | 351 builder->addPlugin("pdf", "pdf", "pdf-files"); |
| 358 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); | 352 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); |
| 359 } | 353 } |
| 360 | 354 |
| 361 } // namespace content | 355 } // namespace content |
| OLD | NEW |