OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell/shell_browser_main.h" | 5 #include "content/shell/shell_browser_main.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 CHECK(browser_context_path_for_layout_tests.CreateUniqueTempDir()); | 120 CHECK(browser_context_path_for_layout_tests.CreateUniqueTempDir()); |
121 CHECK(!browser_context_path_for_layout_tests.path().MaybeAsASCII().empty()); | 121 CHECK(!browser_context_path_for_layout_tests.path().MaybeAsASCII().empty()); |
122 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 122 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
123 switches::kContentShellDataPath, | 123 switches::kContentShellDataPath, |
124 browser_context_path_for_layout_tests.path().MaybeAsASCII()); | 124 browser_context_path_for_layout_tests.path().MaybeAsASCII()); |
125 | 125 |
126 #if defined(OS_ANDROID) | 126 #if defined(OS_ANDROID) |
127 content::EnsureInitializeForAndroidLayoutTests(); | 127 content::EnsureInitializeForAndroidLayoutTests(); |
128 #endif | 128 #endif |
129 } | 129 } |
| 130 scoped_refptr<content::StartupTaskRunner> startup_task_runner = |
| 131 make_scoped_refptr(new content::StartupTaskRunner( |
| 132 content::StartupTaskRunner::IMMEDIATE, NULL)); |
130 | 133 |
131 int exit_code = main_runner->Initialize(parameters); | 134 int exit_code = main_runner->Initialize(parameters, startup_task_runner); |
132 DCHECK_LT(exit_code, 0) | 135 DCHECK_LT(exit_code, 0) |
133 << "BrowserMainRunner::Initialize failed in ShellBrowserMain"; | 136 << "BrowserMainRunner::Initialize failed in ShellBrowserMain"; |
134 | 137 |
135 if (exit_code >= 0) | 138 if (exit_code >= 0) |
136 return exit_code; | 139 return exit_code; |
137 | 140 |
138 if (CommandLine::ForCurrentProcess()->HasSwitch( | 141 if (CommandLine::ForCurrentProcess()->HasSwitch( |
139 switches::kCheckLayoutTestSysDeps)) { | 142 switches::kCheckLayoutTestSysDeps)) { |
140 base::MessageLoop::current()->PostTask(FROM_HERE, | 143 base::MessageLoop::current()->PostTask(FROM_HERE, |
141 base::MessageLoop::QuitClosure()); | 144 base::MessageLoop::QuitClosure()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 208 |
206 #if !defined(OS_ANDROID) | 209 #if !defined(OS_ANDROID) |
207 if (!layout_test_mode) | 210 if (!layout_test_mode) |
208 exit_code = main_runner->Run(); | 211 exit_code = main_runner->Run(); |
209 | 212 |
210 main_runner->Shutdown(); | 213 main_runner->Shutdown(); |
211 #endif | 214 #endif |
212 | 215 |
213 return exit_code; | 216 return exit_code; |
214 } | 217 } |
OLD | NEW |