| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |