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

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: Fix misplaced ifdef for Windows 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { 84 TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
85 #if defined(OS_MACOSX) 85 #if defined(OS_MACOSX)
86 base::mac::ScopedNSAutoreleasePool autorelease_pool; 86 base::mac::ScopedNSAutoreleasePool autorelease_pool;
87 #endif 87 #endif
88 88
89 url_loader_factory_.reset(new WebURLLoaderMockFactory()); 89 url_loader_factory_.reset(new WebURLLoaderMockFactory());
90 mock_clipboard_.reset(new MockWebClipboardImpl()); 90 mock_clipboard_.reset(new MockWebClipboardImpl());
91 91
92 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 92 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
93 gin::V8Initializer::LoadV8Snapshot(); 93 gin::V8Initializer::LoadV8Snapshot();
94 gin::V8Initializer::LoadV8Natives();
94 #endif 95 #endif
95 96
96 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner; 97 scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner;
97 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle; 98 scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle;
98 if (!base::ThreadTaskRunnerHandle::IsSet()) { 99 if (!base::ThreadTaskRunnerHandle::IsSet()) {
99 // Dummy task runner is initialized here because the blink::initialize 100 // Dummy task runner is initialized here because the blink::initialize
100 // creates IsolateHolder which needs the current task runner handle. There 101 // creates IsolateHolder which needs the current task runner handle. There
101 // should be no task posted to this task runner. The message loop is not 102 // should be no task posted to this task runner. The message loop is not
102 // created before this initialization because some tests need specific kinds 103 // created before this initialization because some tests need specific kinds
103 // of message loops, and their types are not known upfront. Some tests also 104 // of message loops, and their types are not known upfront. Some tests also
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 DCHECK(base::MessageLoop::current()); 375 DCHECK(base::MessageLoop::current());
375 DCHECK(!base::MessageLoop::current()->is_running()); 376 DCHECK(!base::MessageLoop::current()->is_running());
376 base::MessageLoop::current()->Run(); 377 base::MessageLoop::current()->Run();
377 } 378 }
378 379
379 void TestBlinkWebUnitTestSupport::exitRunLoop() { 380 void TestBlinkWebUnitTestSupport::exitRunLoop() {
380 base::MessageLoop::current()->Quit(); 381 base::MessageLoop::current()->Quit();
381 } 382 }
382 383
383 } // namespace content 384 } // namespace content
OLDNEW
« no previous file with comments | « content/test/content_test_launcher.cc ('k') | extensions/shell/browser/shell_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698