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

Side by Side Diff: content/shell/browser/layout_test/layout_test_browser_main.cc

Issue 2540603004: [Android] Redirect std{in,out,err} to sockets for layout tests. (Closed)
Patch Set: qyearsley comments Created 4 years 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 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 #include <memory> 8 #include <memory>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 base::ScopedTempDir browser_context_path_for_layout_tests; 116 base::ScopedTempDir browser_context_path_for_layout_tests;
117 117
118 CHECK(browser_context_path_for_layout_tests.CreateUniqueTempDir()); 118 CHECK(browser_context_path_for_layout_tests.CreateUniqueTempDir());
119 CHECK( 119 CHECK(
120 !browser_context_path_for_layout_tests.GetPath().MaybeAsASCII().empty()); 120 !browser_context_path_for_layout_tests.GetPath().MaybeAsASCII().empty());
121 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( 121 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
122 switches::kContentShellDataPath, 122 switches::kContentShellDataPath,
123 browser_context_path_for_layout_tests.GetPath().MaybeAsASCII()); 123 browser_context_path_for_layout_tests.GetPath().MaybeAsASCII());
124 124
125 #if defined(OS_ANDROID) 125 #if defined(OS_ANDROID)
126 content::EnsureInitializeForAndroidLayoutTests(); 126 content::ScopedAndroidConfiguration android_configuration;
127 android_configuration.Initialize();
127 #endif 128 #endif
128 129
129 int exit_code = main_runner->Initialize(parameters); 130 int exit_code = main_runner->Initialize(parameters);
130 DCHECK_LT(exit_code, 0) 131 DCHECK_LT(exit_code, 0)
131 << "BrowserMainRunner::Initialize failed in LayoutTestBrowserMain"; 132 << "BrowserMainRunner::Initialize failed in LayoutTestBrowserMain";
132 133
133 if (exit_code >= 0) 134 if (exit_code >= 0)
134 return exit_code; 135 return exit_code;
135 136
137 #if defined(OS_ANDROID)
138 android_configuration.RedirectStreams();
Peter Beverloo 2016/12/06 19:24:06 What's the reason that you're splitting up the con
jbudorick 2016/12/08 02:04:13 - Initialize has to run before main_runner->Initia
139 #endif
140
136 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 141 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
137 switches::kCheckLayoutTestSysDeps)) { 142 switches::kCheckLayoutTestSysDeps)) {
138 base::ThreadTaskRunnerHandle::Get()->PostTask( 143 base::ThreadTaskRunnerHandle::Get()->PostTask(
139 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 144 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
140 main_runner->Run(); 145 main_runner->Run();
141 content::Shell::CloseAllWindows(); 146 content::Shell::CloseAllWindows();
142 main_runner->Shutdown(); 147 main_runner->Shutdown();
143 return 0; 148 return 0;
144 } 149 }
145 150
146 exit_code = RunTests(main_runner); 151 exit_code = RunTests(main_runner);
147 base::RunLoop().RunUntilIdle(); 152 base::RunLoop().RunUntilIdle();
148 153
149 content::Shell::CloseAllWindows(); 154 content::Shell::CloseAllWindows();
150 #if !defined(OS_ANDROID) 155 #if !defined(OS_ANDROID)
151 main_runner->Shutdown(); 156 main_runner->Shutdown();
152 #endif 157 #endif
153 158
154 return exit_code; 159 return exit_code;
155 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698