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" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
17 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "cc/blink/web_layer_impl.h" | 19 #include "cc/blink/web_layer_impl.h" |
20 #include "cc/test/test_shared_bitmap_manager.h" | 20 #include "cc/test/test_shared_bitmap_manager.h" |
21 #include "cc/trees/layer_tree_settings.h" | 21 #include "cc/trees/layer_tree_settings.h" |
22 #include "content/app/mojo/mojo_init.h" | |
22 #include "content/child/web_url_loader_impl.h" | 23 #include "content/child/web_url_loader_impl.h" |
23 #include "content/test/mock_webclipboard_impl.h" | 24 #include "content/test/mock_webclipboard_impl.h" |
24 #include "content/test/web_gesture_curve_mock.h" | 25 #include "content/test/web_gesture_curve_mock.h" |
25 #include "media/base/media.h" | 26 #include "media/base/media.h" |
26 #include "net/cookies/cookie_monster.h" | 27 #include "net/cookies/cookie_monster.h" |
27 #include "storage/browser/database/vfs_backend.h" | 28 #include "storage/browser/database/vfs_backend.h" |
28 #include "third_party/WebKit/public/platform/WebConnectionType.h" | 29 #include "third_party/WebKit/public/platform/WebConnectionType.h" |
29 #include "third_party/WebKit/public/platform/WebData.h" | 30 #include "third_party/WebKit/public/platform/WebData.h" |
30 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 31 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
31 #include "third_party/WebKit/public/platform/WebString.h" | 32 #include "third_party/WebKit/public/platform/WebString.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 new base::ThreadTaskRunnerHandle(dummy_task_runner)); | 118 new base::ThreadTaskRunnerHandle(dummy_task_runner)); |
118 } | 119 } |
119 renderer_scheduler_ = blink::scheduler::CreateRendererSchedulerForTests(); | 120 renderer_scheduler_ = blink::scheduler::CreateRendererSchedulerForTests(); |
120 web_thread_ = renderer_scheduler_->CreateMainThread(); | 121 web_thread_ = renderer_scheduler_->CreateMainThread(); |
121 shared_bitmap_manager_.reset(new cc::TestSharedBitmapManager); | 122 shared_bitmap_manager_.reset(new cc::TestSharedBitmapManager); |
122 | 123 |
123 // Set up a FeatureList instance, so that code using that API will not hit a | 124 // Set up a FeatureList instance, so that code using that API will not hit a |
124 // an error that it's not set. Cleared by ClearInstanceForTesting() below. | 125 // an error that it's not set. Cleared by ClearInstanceForTesting() below. |
125 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList)); | 126 base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList)); |
126 | 127 |
128 // Initialize mojo firstly to enable Blink initialization use it. | |
blundell
2016/10/18 12:32:11
nit: s/use/to use
leonhsl(Using Gerrit)
2016/10/18 14:34:48
Acknowledged.
leonhsl(Using Gerrit)
2016/10/19 08:47:22
Done.
| |
129 InitializeMojo(); | |
130 | |
127 blink::initialize(this); | 131 blink::initialize(this); |
128 blink::setLayoutTestMode(true); | 132 blink::setLayoutTestMode(true); |
129 blink::WebRuntimeFeatures::enableDatabase(true); | 133 blink::WebRuntimeFeatures::enableDatabase(true); |
130 blink::WebRuntimeFeatures::enableNotifications(true); | 134 blink::WebRuntimeFeatures::enableNotifications(true); |
131 blink::WebRuntimeFeatures::enableTouch(true); | 135 blink::WebRuntimeFeatures::enableTouch(true); |
132 | 136 |
133 // Initialize NetworkStateNotifier. | 137 // Initialize NetworkStateNotifier. |
134 blink::WebNetworkStateNotifier::setWebConnection( | 138 blink::WebNetworkStateNotifier::setWebConnection( |
135 blink::WebConnectionType::WebConnectionTypeUnknown, | 139 blink::WebConnectionType::WebConnectionTypeUnknown, |
136 std::numeric_limits<double>::infinity()); | 140 std::numeric_limits<double>::infinity()); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 blink::WebRTCCertificateGenerator* | 346 blink::WebRTCCertificateGenerator* |
343 TestBlinkWebUnitTestSupport::createRTCCertificateGenerator() { | 347 TestBlinkWebUnitTestSupport::createRTCCertificateGenerator() { |
344 #if defined(ENABLE_WEBRTC) | 348 #if defined(ENABLE_WEBRTC) |
345 return new TestWebRTCCertificateGenerator(); | 349 return new TestWebRTCCertificateGenerator(); |
346 #else | 350 #else |
347 return nullptr; | 351 return nullptr; |
348 #endif | 352 #endif |
349 } | 353 } |
350 | 354 |
351 } // namespace content | 355 } // namespace content |
OLD | NEW |