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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 10907162: Reland: Take 2: Force python test server output to be unbuffered, so it doesn't mix with gtest outpu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't use unbuffered mode on Windows. Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
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/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 return false; 507 return false;
508 } 508 }
509 509
510 started_ = true; 510 started_ = true;
511 return true; 511 return true;
512 } 512 }
513 513
514 CommandLine* TestWebSocketServer::CreatePythonCommandLine() { 514 CommandLine* TestWebSocketServer::CreatePythonCommandLine() {
515 // Note: Python's first argument must be the script; do not append CommandLine 515 // Note: Python's first argument must be the script; do not append CommandLine
516 // switches, as they would precede the script path and break this CommandLine. 516 // switches, as they would precede the script path and break this CommandLine.
517 FilePath path; 517 CommandLine* cmd_line = new CommandLine(CommandLine::NO_PROGRAM);
518 CHECK(GetPythonRunTime(&path)); 518 // TODO(phajdan.jr): Instead of CHECKing, return a boolean indicating success.
519 return new CommandLine(path); 519 CHECK(GetPythonCommand(cmd_line));
520 return cmd_line;
520 } 521 }
521 522
522 void TestWebSocketServer::SetPythonPath() { 523 void TestWebSocketServer::SetPythonPath() {
523 FilePath scripts_path; 524 FilePath scripts_path;
524 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path); 525 PathService::Get(base::DIR_SOURCE_ROOT, &scripts_path);
525 526
526 scripts_path = scripts_path 527 scripts_path = scripts_path
527 .Append(FILE_PATH_LITERAL("third_party")) 528 .Append(FILE_PATH_LITERAL("third_party"))
528 .Append(FILE_PATH_LITERAL("WebKit")) 529 .Append(FILE_PATH_LITERAL("WebKit"))
529 .Append(FILE_PATH_LITERAL("Tools")) 530 .Append(FILE_PATH_LITERAL("Tools"))
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 base::LaunchProcess(*cmd_line.get(), options, NULL); 563 base::LaunchProcess(*cmd_line.get(), options, NULL);
563 564
564 #if defined(OS_POSIX) 565 #if defined(OS_POSIX)
565 // Just to make sure that the server process terminates certainly. 566 // Just to make sure that the server process terminates certainly.
566 if (process_group_id_ != base::kNullProcessHandle) 567 if (process_group_id_ != base::kNullProcessHandle)
567 base::KillProcessGroup(process_group_id_); 568 base::KillProcessGroup(process_group_id_);
568 #endif 569 #endif
569 } 570 }
570 571
571 } // namespace content 572 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | content/test/layout_test_http_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698