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

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

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add natives_fd_exists and snapshot_fd_exists instead of checking for -1 Created 5 years, 6 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
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/path_service.h" 10 #include "base/path_service.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { 83 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
84 #if defined(OS_MACOSX) 84 #if defined(OS_MACOSX)
85 base::mac::ScopedNSAutoreleasePool autorelease_pool; 85 base::mac::ScopedNSAutoreleasePool autorelease_pool;
86 #endif 86 #endif
87 87
88 url_loader_factory_.reset(new WebURLLoaderMockFactory()); 88 url_loader_factory_.reset(new WebURLLoaderMockFactory());
89 mock_clipboard_.reset(new MockWebClipboardImpl()); 89 mock_clipboard_.reset(new MockWebClipboardImpl());
90 90
91 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 91 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
92 gin::V8Initializer::LoadV8Snapshot(); 92 gin::V8Initializer::LoadV8Snapshot();
93 gin::V8Initializer::LoadV8Natives();
93 #endif 94 #endif
94 95
95 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; 96 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner;
96 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; 97 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle;
97 if (base::MessageLoopProxy::current()) { 98 if (base::MessageLoopProxy::current()) {
98 renderer_scheduler_ = scheduler::RendererScheduler::Create(); 99 renderer_scheduler_ = scheduler::RendererScheduler::Create();
99 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler( 100 web_thread_.reset(new scheduler::WebThreadImplForRendererScheduler(
100 renderer_scheduler_.get())); 101 renderer_scheduler_.get()));
101 } else { 102 } else {
102 // Dummy task runner is initialized here because the blink::initialize 103 // Dummy task runner is initialized here because the blink::initialize
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 DCHECK(base::MessageLoop::current()); 374 DCHECK(base::MessageLoop::current());
374 DCHECK(!base::MessageLoop::current()->is_running()); 375 DCHECK(!base::MessageLoop::current()->is_running());
375 base::MessageLoop::current()->Run(); 376 base::MessageLoop::current()->Run();
376 } 377 }
377 378
378 void TestBlinkWebUnitTestSupport::exitRunLoop() { 379 void TestBlinkWebUnitTestSupport::exitRunLoop() {
379 base::MessageLoop::current()->Quit(); 380 base::MessageLoop::current()->Quit();
380 } 381 }
381 382
382 } // namespace content 383 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698