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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_test.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
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.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 (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 // This test uses the safebrowsing test server published at 5 // This test uses the safebrowsing test server published at
6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing 6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing
7 // protocol implemetation. Details of the safebrowsing testing flow is 7 // protocol implemetation. Details of the safebrowsing testing flow is
8 // documented at 8 // documented at
9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting 9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting
10 // 10 //
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 FilePath pyproto_code_dir; 138 FilePath pyproto_code_dir;
139 if (!GetPyProtoPath(&pyproto_code_dir)) { 139 if (!GetPyProtoPath(&pyproto_code_dir)) {
140 LOG(ERROR) << "Failed to get generated python protobuf dir"; 140 LOG(ERROR) << "Failed to get generated python protobuf dir";
141 return false; 141 return false;
142 } 142 }
143 AppendToPythonPath(pyproto_code_dir); 143 AppendToPythonPath(pyproto_code_dir);
144 pyproto_code_dir = pyproto_code_dir.Append(FILE_PATH_LITERAL("google")); 144 pyproto_code_dir = pyproto_code_dir.Append(FILE_PATH_LITERAL("google"));
145 AppendToPythonPath(pyproto_code_dir); 145 AppendToPythonPath(pyproto_code_dir);
146 146
147 FilePath python_runtime; 147 CommandLine cmd_line(CommandLine::NO_PROGRAM);
148 EXPECT_TRUE(GetPythonRunTime(&python_runtime)); 148 EXPECT_TRUE(GetPythonCommand(&cmd_line));
149 CommandLine cmd_line(python_runtime); 149
150 // Make python stdout and stderr unbuffered, to prevent incomplete stderr on
151 // win bots, and also fix mixed up ordering of stdout and stderr.
152 cmd_line.AppendSwitch("-u");
153 FilePath datafile = testserver_path.Append(datafile_); 150 FilePath datafile = testserver_path.Append(datafile_);
154 cmd_line.AppendArgPath(testserver); 151 cmd_line.AppendArgPath(testserver);
155 cmd_line.AppendArg(base::StringPrintf("--port=%d", kPort_)); 152 cmd_line.AppendArg(base::StringPrintf("--port=%d", kPort_));
156 cmd_line.AppendArgNative(FILE_PATH_LITERAL("--datafile=") + 153 cmd_line.AppendArgNative(FILE_PATH_LITERAL("--datafile=") +
157 datafile.value()); 154 datafile.value());
158 155
159 base::LaunchOptions options; 156 base::LaunchOptions options;
160 #if defined(OS_WIN) 157 #if defined(OS_WIN)
161 options.start_hidden = true; 158 options.start_hidden = true;
162 #endif 159 #endif
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 629 }
633 630
634 // Verifies with server if test is done and waits till server responses. 631 // Verifies with server if test is done and waits till server responses.
635 EXPECT_EQ(net::URLRequestStatus::SUCCESS, 632 EXPECT_EQ(net::URLRequestStatus::SUCCESS,
636 safe_browsing_helper->VerifyTestComplete(server_host, 633 safe_browsing_helper->VerifyTestComplete(server_host,
637 server_port, 634 server_port,
638 last_step)); 635 last_step));
639 EXPECT_EQ("yes", safe_browsing_helper->response_data()); 636 EXPECT_EQ("yes", safe_browsing_helper->response_data());
640 test_server.Stop(); 637 test_server.Stop();
641 } 638 }
OLDNEW
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698