OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 AppendToPythonPath(pyproto_code_dir); | 135 AppendToPythonPath(pyproto_code_dir); |
136 pyproto_code_dir = pyproto_code_dir.Append(FILE_PATH_LITERAL("google")); | 136 pyproto_code_dir = pyproto_code_dir.Append(FILE_PATH_LITERAL("google")); |
137 AppendToPythonPath(pyproto_code_dir); | 137 AppendToPythonPath(pyproto_code_dir); |
138 | 138 |
139 FilePath python_runtime; | 139 FilePath python_runtime; |
140 EXPECT_TRUE(GetPythonRunTime(&python_runtime)); | 140 EXPECT_TRUE(GetPythonRunTime(&python_runtime)); |
141 CommandLine cmd_line(python_runtime); | 141 CommandLine cmd_line(python_runtime); |
142 FilePath datafile = testserver_path.Append(datafile_); | 142 FilePath datafile = testserver_path.Append(datafile_); |
143 cmd_line.AppendArgPath(testserver); | 143 cmd_line.AppendArgPath(testserver); |
144 cmd_line.AppendSwitchASCII("port", base::StringPrintf("%d", kPort_)); | 144 cmd_line.AppendArg(base::StringPrintf("--port=%d", kPort_)); |
145 cmd_line.AppendSwitchPath("datafile", datafile); | 145 cmd_line.AppendArgNative(FILE_PATH_LITERAL("--datafile=") + |
| 146 datafile.value()); |
146 | 147 |
147 if (!base::LaunchApp(cmd_line, false, true, &server_handle_)) { | 148 if (!base::LaunchApp(cmd_line, false, true, &server_handle_)) { |
148 LOG(ERROR) << "Failed to launch server: " | 149 LOG(ERROR) << "Failed to launch server: " |
149 << cmd_line.command_line_string(); | 150 << cmd_line.command_line_string(); |
150 return false; | 151 return false; |
151 } | 152 } |
152 return true; | 153 return true; |
153 } | 154 } |
154 | 155 |
155 // Stop the python server test suite. | 156 // Stop the python server test suite. |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 633 } |
633 | 634 |
634 // Verifies with server if test is done and waits till server responses. | 635 // Verifies with server if test is done and waits till server responses. |
635 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 636 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
636 safe_browsing_helper->VerifyTestComplete(server_host, | 637 safe_browsing_helper->VerifyTestComplete(server_host, |
637 server_port, | 638 server_port, |
638 last_step)); | 639 last_step)); |
639 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 640 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
640 test_server.Stop(); | 641 test_server.Stop(); |
641 } | 642 } |
OLD | NEW |