| 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" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "content/renderer/scheduler/renderer_scheduler.h" | 12 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 13 #include "content/renderer/scheduler/webthread_impl_for_renderer_scheduler.h" | 13 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" |
| 14 #include "content/test/mock_webclipboard_impl.h" | 14 #include "content/test/mock_webclipboard_impl.h" |
| 15 #include "content/test/web_gesture_curve_mock.h" | 15 #include "content/test/web_gesture_curve_mock.h" |
| 16 #include "content/test/web_layer_tree_view_impl_for_testing.h" | 16 #include "content/test/web_layer_tree_view_impl_for_testing.h" |
| 17 #include "content/test/weburl_loader_mock_factory.h" | 17 #include "content/test/weburl_loader_mock_factory.h" |
| 18 #include "media/base/media.h" | 18 #include "media/base/media.h" |
| 19 #include "net/cookies/cookie_monster.h" | 19 #include "net/cookies/cookie_monster.h" |
| 20 #include "net/test/spawned_test_server/spawned_test_server.h" | 20 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 21 #include "storage/browser/database/vfs_backend.h" | 21 #include "storage/browser/database/vfs_backend.h" |
| 22 #include "third_party/WebKit/public/platform/WebData.h" | 22 #include "third_party/WebKit/public/platform/WebData.h" |
| 23 #include "third_party/WebKit/public/platform/WebFileSystem.h" | 23 #include "third_party/WebKit/public/platform/WebFileSystem.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 url_loader_factory_.reset(new WebURLLoaderMockFactory()); | 51 url_loader_factory_.reset(new WebURLLoaderMockFactory()); |
| 52 mock_clipboard_.reset(new MockWebClipboardImpl()); | 52 mock_clipboard_.reset(new MockWebClipboardImpl()); |
| 53 | 53 |
| 54 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 54 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 55 gin::V8Initializer::LoadV8Snapshot(); | 55 gin::V8Initializer::LoadV8Snapshot(); |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 if (base::MessageLoopProxy::current()) { | 58 if (base::MessageLoopProxy::current()) { |
| 59 renderer_scheduler_ = RendererScheduler::Create(); | 59 renderer_scheduler_ = scheduler::RendererScheduler::Create(); |
| 60 web_thread_.reset( | 60 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( |
| 61 new WebThreadImplForRendererScheduler(renderer_scheduler_.get())); | 61 renderer_scheduler_.get())); |
| 62 } | 62 } |
| 63 | 63 |
| 64 blink::initialize(this); | 64 blink::initialize(this); |
| 65 blink::setLayoutTestMode(true); | 65 blink::setLayoutTestMode(true); |
| 66 blink::WebSecurityPolicy::registerURLSchemeAsLocal( | 66 blink::WebSecurityPolicy::registerURLSchemeAsLocal( |
| 67 blink::WebString::fromUTF8("test-shell-resource")); | 67 blink::WebString::fromUTF8("test-shell-resource")); |
| 68 blink::WebSecurityPolicy::registerURLSchemeAsNoAccess( | 68 blink::WebSecurityPolicy::registerURLSchemeAsNoAccess( |
| 69 blink::WebString::fromUTF8("test-shell-resource")); | 69 blink::WebString::fromUTF8("test-shell-resource")); |
| 70 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( | 70 blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( |
| 71 blink::WebString::fromUTF8("test-shell-resource")); | 71 blink::WebString::fromUTF8("test-shell-resource")); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return blob_registry_.GetBlobItems(uuid, items); | 313 return blob_registry_.GetBlobItems(uuid, items); |
| 314 } | 314 } |
| 315 | 315 |
| 316 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { | 316 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { |
| 317 if (web_thread_ && web_thread_->isCurrentThread()) | 317 if (web_thread_ && web_thread_->isCurrentThread()) |
| 318 return web_thread_.get(); | 318 return web_thread_.get(); |
| 319 return BlinkPlatformImpl::currentThread(); | 319 return BlinkPlatformImpl::currentThread(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace content | 322 } // namespace content |
| OLD | NEW |