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

Side by Side Diff: headless/test/headless_browser_test.cc

Issue 2762593002: Add --headless flag to Windows (Closed)
Patch Set: fix headless_shell build Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/test/headless_browser_test.h" 5 #include "headless/test/headless_browser_test.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 web_contents_->GetDevToolsTarget()->AttachClient(devtools_client_.get()); 201 web_contents_->GetDevToolsTarget()->AttachClient(devtools_client_.get());
202 RunDevTooledTest(); 202 RunDevTooledTest();
203 } 203 }
204 204
205 void HeadlessAsyncDevTooledBrowserTest::RenderProcessExited( 205 void HeadlessAsyncDevTooledBrowserTest::RenderProcessExited(
206 base::TerminationStatus status, 206 base::TerminationStatus status,
207 int exit_code) { 207 int exit_code) {
208 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION) 208 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION)
209 return; 209 return;
210 210
211 FAIL() << "Abnormal renderer termination";
212 FinishAsynchronousTest(); 211 FinishAsynchronousTest();
213 render_process_exited_ = true; 212 render_process_exited_ = true;
213 FAIL() << "Abnormal renderer termination";
214 } 214 }
215 215
216 void HeadlessAsyncDevTooledBrowserTest::RunTest() { 216 void HeadlessAsyncDevTooledBrowserTest::RunTest() {
217 browser_context_ = browser() 217 browser_context_ = browser()
218 ->CreateBrowserContextBuilder() 218 ->CreateBrowserContextBuilder()
219 .SetProtocolHandlers(GetProtocolHandlers()) 219 .SetProtocolHandlers(GetProtocolHandlers())
220 .Build(); 220 .Build();
221 browser()->SetDefaultBrowserContext(browser_context_); 221 browser()->SetDefaultBrowserContext(browser_context_);
222 222
223 web_contents_ = browser_context_->CreateWebContentsBuilder().Build(); 223 web_contents_ = browser_context_->CreateWebContentsBuilder().Build();
224 web_contents_->AddObserver(this); 224 web_contents_->AddObserver(this);
225 225
226 RunAsynchronousTest(); 226 RunAsynchronousTest();
227 227
228 if (!render_process_exited_) 228 if (!render_process_exited_)
229 web_contents_->GetDevToolsTarget()->DetachClient(devtools_client_.get()); 229 web_contents_->GetDevToolsTarget()->DetachClient(devtools_client_.get());
230 web_contents_->RemoveObserver(this); 230 web_contents_->RemoveObserver(this);
231 web_contents_->Close(); 231 web_contents_->Close();
232 web_contents_ = nullptr; 232 web_contents_ = nullptr;
233 browser_context_->Close(); 233 browser_context_->Close();
234 browser_context_ = nullptr; 234 browser_context_ = nullptr;
235 } 235 }
236 236
237 ProtocolHandlerMap HeadlessAsyncDevTooledBrowserTest::GetProtocolHandlers() { 237 ProtocolHandlerMap HeadlessAsyncDevTooledBrowserTest::GetProtocolHandlers() {
238 return ProtocolHandlerMap(); 238 return ProtocolHandlerMap();
239 } 239 }
240 240
241 } // namespace headless 241 } // namespace headless
OLDNEW
« headless/public/headless_browser.cc ('K') | « headless/public/headless_shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698