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