| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 url_loader_factory_.reset(new WebURLLoaderMockFactory()); | 118 url_loader_factory_.reset(new WebURLLoaderMockFactory()); |
| 119 mock_clipboard_.reset(new MockWebClipboardImpl()); | 119 mock_clipboard_.reset(new MockWebClipboardImpl()); |
| 120 | 120 |
| 121 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 121 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 122 gin::V8Initializer::LoadV8Snapshot(); | 122 gin::V8Initializer::LoadV8Snapshot(); |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; | 125 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; |
| 126 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; | 126 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; |
| 127 if (base::MessageLoopProxy::current()) { | 127 if (base::ThreadTaskRunnerHandle::Get()) { |
| 128 renderer_scheduler_ = scheduler::RendererScheduler::Create(); | 128 renderer_scheduler_ = scheduler::RendererScheduler::Create(); |
| 129 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( | 129 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( |
| 130 renderer_scheduler_.get())); | 130 renderer_scheduler_.get())); |
| 131 } else { | 131 } else { |
| 132 // Dummy task runner is initialized here because the blink::initialize | 132 // Dummy task runner is initialized here because the blink::initialize |
| 133 // creates IsolateHolder which needs the current task runner handle. There | 133 // creates IsolateHolder which needs the current task runner handle. There |
| 134 // should be no task posted to this task runner. The message loop is not | 134 // should be no task posted to this task runner. The message loop is not |
| 135 // created before this initialization because some tests need specific kinds | 135 // created before this initialization because some tests need specific kinds |
| 136 // of message loops, and their types are not known upfront. Some tests also | 136 // of message loops, and their types are not known upfront. Some tests also |
| 137 // create their own thread bundles or message loops, and doing the same in | 137 // create their own thread bundles or message loops, and doing the same in |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 DCHECK(base::MessageLoop::current()); | 404 DCHECK(base::MessageLoop::current()); |
| 405 DCHECK(!base::MessageLoop::current()->is_running()); | 405 DCHECK(!base::MessageLoop::current()->is_running()); |
| 406 base::MessageLoop::current()->Run(); | 406 base::MessageLoop::current()->Run(); |
| 407 } | 407 } |
| 408 | 408 |
| 409 void TestBlinkWebUnitTestSupport::exitRunLoop() { | 409 void TestBlinkWebUnitTestSupport::exitRunLoop() { |
| 410 base::MessageLoop::current()->Quit(); | 410 base::MessageLoop::current()->Quit(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace content | 413 } // namespace content |
| OLD | NEW |