| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { | 83 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { |
| 84 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
| 85 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 85 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 url_loader_factory_.reset(new WebURLLoaderMockFactory()); | 88 url_loader_factory_.reset(new WebURLLoaderMockFactory()); |
| 89 mock_clipboard_.reset(new MockWebClipboardImpl()); | 89 mock_clipboard_.reset(new MockWebClipboardImpl()); |
| 90 | 90 |
| 91 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 91 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 92 gin::V8Initializer::LoadV8Snapshot(); | 92 gin::V8Initializer::LoadV8Snapshot(); |
| 93 gin::V8Initializer::LoadV8Natives(); |
| 93 #endif | 94 #endif |
| 94 | 95 |
| 95 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; | 96 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; |
| 96 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; | 97 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; |
| 97 if (base::MessageLoopProxy::current()) { | 98 if (base::MessageLoopProxy::current()) { |
| 98 renderer_scheduler_ = scheduler::RendererScheduler::Create(); | 99 renderer_scheduler_ = scheduler::RendererScheduler::Create(); |
| 99 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( | 100 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( |
| 100 renderer_scheduler_.get())); | 101 renderer_scheduler_.get())); |
| 101 } else { | 102 } else { |
| 102 // Dummy task runner is initialized here because the blink::initialize | 103 // Dummy task runner is initialized here because the blink::initialize |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 DCHECK(base::MessageLoop::current()); | 374 DCHECK(base::MessageLoop::current()); |
| 374 DCHECK(!base::MessageLoop::current()->is_running()); | 375 DCHECK(!base::MessageLoop::current()->is_running()); |
| 375 base::MessageLoop::current()->Run(); | 376 base::MessageLoop::current()->Run(); |
| 376 } | 377 } |
| 377 | 378 |
| 378 void TestBlinkWebUnitTestSupport::exitRunLoop() { | 379 void TestBlinkWebUnitTestSupport::exitRunLoop() { |
| 379 base::MessageLoop::current()->Quit(); | 380 base::MessageLoop::current()->Quit(); |
| 380 } | 381 } |
| 381 | 382 |
| 382 } // namespace content | 383 } // namespace content |
| OLD | NEW |