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/shell/browser/layout_test/layout_test_browser_main.cc

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/shell/browser/blink_test_controller.cc ('k') | content/shell/browser/shell.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/layout_test/layout_test_browser_main.h" 5 #include "content/shell/browser/layout_test/layout_test_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/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/location.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
16 #include "base/single_thread_task_runner.h" 15 #include "base/message_loop/message_loop.h"
17 #include "base/strings/sys_string_conversions.h" 16 #include "base/strings/sys_string_conversions.h"
18 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
19 #include "base/thread_task_runner_handle.h"
20 #include "base/threading/thread_restrictions.h" 18 #include "base/threading/thread_restrictions.h"
21 #include "content/public/browser/browser_main_runner.h" 19 #include "content/public/browser/browser_main_runner.h"
22 #include "content/public/common/url_constants.h" 20 #include "content/public/common/url_constants.h"
23 #include "content/shell/browser/blink_test_controller.h" 21 #include "content/shell/browser/blink_test_controller.h"
24 #include "content/shell/browser/shell.h" 22 #include "content/shell/browser/shell.h"
25 #include "content/shell/common/shell_switches.h" 23 #include "content/shell/common/shell_switches.h"
26 #include "content/shell/renderer/layout_test/blink_test_helpers.h" 24 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
27 #include "net/base/filename_util.h" 25 #include "net/base/filename_util.h"
28 26
29 #if defined(OS_ANDROID) 27 #if defined(OS_ANDROID)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 bool ran_at_least_once = false; 163 bool ran_at_least_once = false;
166 164
167 std::cout << "#READY\n"; 165 std::cout << "#READY\n";
168 std::cout.flush(); 166 std::cout.flush();
169 167
170 while (GetNextTest(args, &command_line_position, &test_string)) { 168 while (GetNextTest(args, &command_line_position, &test_string)) {
171 if (!RunOneTest(test_string, &ran_at_least_once, main_runner)) 169 if (!RunOneTest(test_string, &ran_at_least_once, main_runner))
172 break; 170 break;
173 } 171 }
174 if (!ran_at_least_once) { 172 if (!ran_at_least_once) {
175 base::ThreadTaskRunnerHandle::Get()->PostTask( 173 base::MessageLoop::current()->PostTask(FROM_HERE,
176 FROM_HERE, base::MessageLoop::QuitClosure()); 174 base::MessageLoop::QuitClosure());
177 main_runner->Run(); 175 main_runner->Run();
178 } 176 }
179 177
180 #if defined(OS_ANDROID) 178 #if defined(OS_ANDROID)
181 // We need to execute 'main_runner->Shutdown()' before the test_controller 179 // We need to execute 'main_runner->Shutdown()' before the test_controller
182 // destructs when running on Android, and after it destructs when running 180 // destructs when running on Android, and after it destructs when running
183 // anywhere else. 181 // anywhere else.
184 main_runner->Shutdown(); 182 main_runner->Shutdown();
185 #endif 183 #endif
186 184
(...skipping 20 matching lines...) Expand all
207 205
208 int exit_code = main_runner->Initialize(parameters); 206 int exit_code = main_runner->Initialize(parameters);
209 DCHECK_LT(exit_code, 0) 207 DCHECK_LT(exit_code, 0)
210 << "BrowserMainRunner::Initialize failed in LayoutTestBrowserMain"; 208 << "BrowserMainRunner::Initialize failed in LayoutTestBrowserMain";
211 209
212 if (exit_code >= 0) 210 if (exit_code >= 0)
213 return exit_code; 211 return exit_code;
214 212
215 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 213 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
216 switches::kCheckLayoutTestSysDeps)) { 214 switches::kCheckLayoutTestSysDeps)) {
217 base::ThreadTaskRunnerHandle::Get()->PostTask( 215 base::MessageLoop::current()->PostTask(FROM_HERE,
218 FROM_HERE, base::MessageLoop::QuitClosure()); 216 base::MessageLoop::QuitClosure());
219 main_runner->Run(); 217 main_runner->Run();
220 content::Shell::CloseAllWindows(); 218 content::Shell::CloseAllWindows();
221 main_runner->Shutdown(); 219 main_runner->Shutdown();
222 return 0; 220 return 0;
223 } 221 }
224 222
225 exit_code = RunTests(main_runner); 223 exit_code = RunTests(main_runner);
226 224
227 #if !defined(OS_ANDROID) 225 #if !defined(OS_ANDROID)
228 main_runner->Shutdown(); 226 main_runner->Shutdown();
229 #endif 227 #endif
230 228
231 return exit_code; 229 return exit_code;
232 } 230 }
OLDNEW
« no previous file with comments | « content/shell/browser/blink_test_controller.cc ('k') | content/shell/browser/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698