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/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 renderer_scheduler_ = base::WrapUnique(new scheduler::RendererSchedulerImpl( | 114 renderer_scheduler_ = base::WrapUnique(new scheduler::RendererSchedulerImpl( |
115 scheduler::LazySchedulerMessageLoopDelegateForTests::Create())); | 115 scheduler::LazySchedulerMessageLoopDelegateForTests::Create())); |
116 web_thread_ = renderer_scheduler_->CreateMainThread(); | 116 web_thread_ = renderer_scheduler_->CreateMainThread(); |
117 | 117 |
118 // Set up a FeatureList instance, so that code using that API will not hit a | 118 // Set up a FeatureList instance, so that code using that API will not hit a |
119 // an error that it's not set. Cleared by ClearInstanceForTesting() below. | 119 // an error that it's not set. Cleared by ClearInstanceForTesting() below. |
120 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList)); | 120 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList)); |
121 | 121 |
122 blink::initialize(this); | 122 blink::initialize(this); |
123 blink::setLayoutTestMode(true); | 123 blink::setLayoutTestMode(true); |
124 blink::WebRuntimeFeatures::enableApplicationCache(true); | |
125 blink::WebRuntimeFeatures::enableDatabase(true); | 124 blink::WebRuntimeFeatures::enableDatabase(true); |
126 blink::WebRuntimeFeatures::enableNotifications(true); | 125 blink::WebRuntimeFeatures::enableNotifications(true); |
127 blink::WebRuntimeFeatures::enableTouch(true); | 126 blink::WebRuntimeFeatures::enableTouch(true); |
128 | 127 |
129 // Initialize NetworkStateNotifier. | 128 // Initialize NetworkStateNotifier. |
130 blink::WebNetworkStateNotifier::setWebConnection( | 129 blink::WebNetworkStateNotifier::setWebConnection( |
131 blink::WebConnectionType::WebConnectionTypeUnknown, | 130 blink::WebConnectionType::WebConnectionTypeUnknown, |
132 std::numeric_limits<double>::infinity()); | 131 std::numeric_limits<double>::infinity()); |
133 | 132 |
134 // Initialize libraries for media. | 133 // Initialize libraries for media. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 return BlinkPlatformImpl::currentThread(); | 291 return BlinkPlatformImpl::currentThread(); |
293 } | 292 } |
294 | 293 |
295 void TestBlinkWebUnitTestSupport::getPluginList( | 294 void TestBlinkWebUnitTestSupport::getPluginList( |
296 bool refresh, blink::WebPluginListBuilder* builder) { | 295 bool refresh, blink::WebPluginListBuilder* builder) { |
297 builder->addPlugin("pdf", "pdf", "pdf-files"); | 296 builder->addPlugin("pdf", "pdf", "pdf-files"); |
298 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); | 297 builder->addMediaTypeToLastPlugin("application/pdf", "pdf"); |
299 } | 298 } |
300 | 299 |
301 } // namespace content | 300 } // namespace content |
OLD | NEW |