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

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

Issue 878413002: Wire the scheduler up in TestBlinkWebUnitTestSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sami's idea Created 5 years, 10 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 | « content/test/test_blink_web_unit_test_support.h ('k') | no next file » | 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/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"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "content/renderer/scheduler/renderer_scheduler.h"
16 #include "content/renderer/scheduler/web_scheduler_impl.h"
15 #include "content/test/mock_webclipboard_impl.h" 17 #include "content/test/mock_webclipboard_impl.h"
16 #include "content/test/web_gesture_curve_mock.h" 18 #include "content/test/web_gesture_curve_mock.h"
17 #include "content/test/web_layer_tree_view_impl_for_testing.h" 19 #include "content/test/web_layer_tree_view_impl_for_testing.h"
18 #include "content/test/weburl_loader_mock_factory.h" 20 #include "content/test/weburl_loader_mock_factory.h"
19 #include "media/base/media.h" 21 #include "media/base/media.h"
20 #include "net/cookies/cookie_monster.h" 22 #include "net/cookies/cookie_monster.h"
21 #include "net/test/spawned_test_server/spawned_test_server.h" 23 #include "net/test/spawned_test_server/spawned_test_server.h"
22 #include "storage/browser/database/vfs_backend.h" 24 #include "storage/browser/database/vfs_backend.h"
23 #include "third_party/WebKit/public/platform/WebData.h" 25 #include "third_party/WebKit/public/platform/WebData.h"
24 #include "third_party/WebKit/public/platform/WebFileSystem.h" 26 #include "third_party/WebKit/public/platform/WebFileSystem.h"
(...skipping 12 matching lines...) Expand all
37 #include "base/mac/foundation_util.h" 39 #include "base/mac/foundation_util.h"
38 #include "base/mac/scoped_nsautorelease_pool.h" 40 #include "base/mac/scoped_nsautorelease_pool.h"
39 #endif 41 #endif
40 42
41 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 43 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
42 #include "gin/public/isolate_holder.h" 44 #include "gin/public/isolate_holder.h"
43 #endif 45 #endif
44 46
45 namespace content { 47 namespace content {
46 48
47 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { 49 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport(
50 scoped_ptr<RendererScheduler> renderer_scheduler)
51 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()),
52 renderer_scheduler_(renderer_scheduler.release()),
no sievers 2015/01/28 18:35:22 nit: drop '.release()', should be able to construc
alex clarke (OOO till 29th) 2015/01/29 11:29:19 Unfortunately I get a compile error if I try that:
53 web_scheduler_(new WebSchedulerImpl(renderer_scheduler_.get())) {
48 #if defined(OS_MACOSX) 54 #if defined(OS_MACOSX)
49 base::mac::ScopedNSAutoreleasePool autorelease_pool; 55 base::mac::ScopedNSAutoreleasePool autorelease_pool;
50 #endif 56 #endif
51 57
52 url_loader_factory_.reset(new WebURLLoaderMockFactory()); 58 url_loader_factory_.reset(new WebURLLoaderMockFactory());
53 mock_clipboard_.reset(new MockWebClipboardImpl()); 59 mock_clipboard_.reset(new MockWebClipboardImpl());
54 60
55 // Create an anonymous stats table since we don't need to share between 61 // Create an anonymous stats table since we don't need to share between
56 // processes. 62 // processes.
57 stats_table_.reset( 63 stats_table_.reset(
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 318
313 return blink::WebData(buffer.data(), buffer.size()); 319 return blink::WebData(buffer.data(), buffer.size());
314 } 320 }
315 321
316 bool TestBlinkWebUnitTestSupport::getBlobItems( 322 bool TestBlinkWebUnitTestSupport::getBlobItems(
317 const blink::WebString& uuid, 323 const blink::WebString& uuid,
318 blink::WebVector<blink::WebBlobData::Item*>* items) { 324 blink::WebVector<blink::WebBlobData::Item*>* items) {
319 return blob_registry_.GetBlobItems(uuid, items); 325 return blob_registry_.GetBlobItems(uuid, items);
320 } 326 }
321 327
328 blink::WebScheduler* TestBlinkWebUnitTestSupport::scheduler() {
329 return web_scheduler_.get();
330 }
331
322 } // namespace content 332 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_blink_web_unit_test_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698