Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: content/test/test_blink_web_unit_test_support.cc

Issue 1088683003: Adding v8_isolate_memory_dump_provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for interface changes and fixing tests. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gin/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop/message_loop.h"
10 #include "base/path_service.h" 11 #include "base/path_service.h"
11 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
12 #include "components/scheduler/renderer/renderer_scheduler.h" 13 #include "components/scheduler/renderer/renderer_scheduler.h"
13 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" 14 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h"
14 #include "content/test/mock_webclipboard_impl.h" 15 #include "content/test/mock_webclipboard_impl.h"
15 #include "content/test/web_gesture_curve_mock.h" 16 #include "content/test/web_gesture_curve_mock.h"
16 #include "content/test/web_layer_tree_view_impl_for_testing.h" 17 #include "content/test/web_layer_tree_view_impl_for_testing.h"
17 #include "content/test/weburl_loader_mock_factory.h" 18 #include "content/test/weburl_loader_mock_factory.h"
18 #include "media/base/media.h" 19 #include "media/base/media.h"
19 #include "net/cookies/cookie_monster.h" 20 #include "net/cookies/cookie_monster.h"
(...skipping 17 matching lines...) Expand all
37 #include "base/mac/scoped_nsautorelease_pool.h" 38 #include "base/mac/scoped_nsautorelease_pool.h"
38 #endif 39 #endif
39 40
40 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 41 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
41 #include "gin/v8_initializer.h" 42 #include "gin/v8_initializer.h"
42 #endif 43 #endif
43 44
44 namespace content { 45 namespace content {
45 46
46 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { 47 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
48 base::MessageLoop message_loop;
47 #if defined(OS_MACOSX) 49 #if defined(OS_MACOSX)
48 base::mac::ScopedNSAutoreleasePool autorelease_pool; 50 base::mac::ScopedNSAutoreleasePool autorelease_pool;
49 #endif 51 #endif
50 52
51 url_loader_factory_.reset(new WebURLLoaderMockFactory()); 53 url_loader_factory_.reset(new WebURLLoaderMockFactory());
52 mock_clipboard_.reset(new MockWebClipboardImpl()); 54 mock_clipboard_.reset(new MockWebClipboardImpl());
53 55
54 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 56 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
55 gin::V8Initializer::LoadV8Snapshot(); 57 gin::V8Initializer::LoadV8Snapshot();
56 #endif 58 #endif
57 59
58 if (base::MessageLoopProxy::current()) { 60 if (base::MessageLoopProxy::current()) {
Sami 2015/04/29 16:15:38 Please remove this guard since it's now unnecessar
ssid 2015/05/08 08:37:40 Done.
59 renderer_scheduler_ = scheduler::RendererScheduler::Create(); 61 renderer_scheduler_ = scheduler::RendererScheduler::Create();
60 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( 62 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler(
61 renderer_scheduler_.get())); 63 renderer_scheduler_.get()));
62 } 64 }
63 65
64 blink::initialize(this); 66 blink::initialize(this);
65 blink::setLayoutTestMode(true); 67 blink::setLayoutTestMode(true);
66 blink::WebSecurityPolicy::registerURLSchemeAsLocal( 68 blink::WebSecurityPolicy::registerURLSchemeAsLocal(
67 blink::WebString::fromUTF8("test-shell-resource")); 69 blink::WebString::fromUTF8("test-shell-resource"));
68 blink::WebSecurityPolicy::registerURLSchemeAsNoAccess( 70 blink::WebSecurityPolicy::registerURLSchemeAsNoAccess(
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return blob_registry_.GetBlobItems(uuid, items); 315 return blob_registry_.GetBlobItems(uuid, items);
314 } 316 }
315 317
316 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() { 318 blink::WebThread* TestBlinkWebUnitTestSupport::currentThread() {
317 if (web_thread_ && web_thread_->isCurrentThread()) 319 if (web_thread_ && web_thread_->isCurrentThread())
318 return web_thread_.get(); 320 return web_thread_.get();
319 return BlinkPlatformImpl::currentThread(); 321 return BlinkPlatformImpl::currentThread();
320 } 322 }
321 323
322 } // namespace content 324 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gin/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698