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/command_line.h" | 7 #include "base/command_line.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 23 matching lines...) Expand all Loading... |
34 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 34 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
35 #include "third_party/WebKit/public/web/WebStorageEventDispatcher.h" | 35 #include "third_party/WebKit/public/web/WebStorageEventDispatcher.h" |
36 #include "v8/include/v8.h" | 36 #include "v8/include/v8.h" |
37 | 37 |
38 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
39 #include "base/mac/foundation_util.h" | 39 #include "base/mac/foundation_util.h" |
40 #include "base/mac/scoped_nsautorelease_pool.h" | 40 #include "base/mac/scoped_nsautorelease_pool.h" |
41 #endif | 41 #endif |
42 | 42 |
43 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 43 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
44 #include "gin/public/isolate_holder.h" | 44 #include "gin/v8_initializer.h" |
45 #endif | 45 #endif |
46 | 46 |
47 namespace content { | 47 namespace content { |
48 | 48 |
49 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { | 49 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { |
50 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
51 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 51 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
52 #endif | 52 #endif |
53 | 53 |
54 url_loader_factory_.reset(new WebURLLoaderMockFactory()); | 54 url_loader_factory_.reset(new WebURLLoaderMockFactory()); |
55 mock_clipboard_.reset(new MockWebClipboardImpl()); | 55 mock_clipboard_.reset(new MockWebClipboardImpl()); |
56 | 56 |
57 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 57 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
58 gin::IsolateHolder::LoadV8Snapshot(); | 58 gin::V8Initializer::LoadV8Snapshot(); |
59 #endif | 59 #endif |
60 | 60 |
61 if (base::MessageLoopProxy::current()) { | 61 if (base::MessageLoopProxy::current()) { |
62 renderer_scheduler_ = RendererScheduler::Create(); | 62 renderer_scheduler_ = RendererScheduler::Create(); |
63 web_scheduler_.reset(new WebSchedulerImpl(renderer_scheduler_.get())); | 63 web_scheduler_.reset(new WebSchedulerImpl(renderer_scheduler_.get())); |
64 web_thread_.reset(new WebThreadImplForScheduler(renderer_scheduler_.get())); | 64 web_thread_.reset(new WebThreadImplForScheduler(renderer_scheduler_.get())); |
65 } | 65 } |
66 | 66 |
67 blink::initialize(this); | 67 blink::initialize(this); |
68 blink::setLayoutTestMode(true); | 68 blink::setLayoutTestMode(true); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return web_scheduler_.get(); | 321 return web_scheduler_.get(); |
322 } | 322 } |
323 | 323 |
324 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { | 324 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { |
325 if (web_thread_ && web_thread_->isCurrentThread()) | 325 if (web_thread_ && web_thread_->isCurrentThread()) |
326 return web_thread_.get(); | 326 return web_thread_.get(); |
327 return BlinkPlatformImpl::currentThread(); | 327 return BlinkPlatformImpl::currentThread(); |
328 } | 328 } |
329 | 329 |
330 } // namespace content | 330 } // namespace content |
OLD | NEW |