| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 } | 343 } |
| 344 | 344 |
| 345 #if defined(OS_WIN) | 345 #if defined(OS_WIN) |
| 346 void LaunchApp(const std::wstring& command_line) { | 346 void LaunchApp(const std::wstring& command_line) { |
| 347 ASSERT_TRUE(base::LaunchApp(command_line, false, true, &process_handle_)) << | 347 ASSERT_TRUE(base::LaunchApp(command_line, false, true, &process_handle_)) << |
| 348 "Failed to launch " << command_line; | 348 "Failed to launch " << command_line; |
| 349 } | 349 } |
| 350 #elif defined(OS_POSIX) | 350 #elif defined(OS_POSIX) |
| 351 void LaunchApp(const std::vector<std::string>& command_line) { | 351 void LaunchApp(const std::vector<std::string>& command_line) { |
| 352 ASSERT_TRUE(base::LaunchApp(command_line, false, true, &process_handle_)) << | 352 base::file_handle_mapping_vector fds_empty; |
| 353 ASSERT_TRUE(base::LaunchApp(command_line, fds_empty, false, |
| 354 &process_handle_)) << |
| 353 "Failed to launch " << command_line[0] << " ..."; | 355 "Failed to launch " << command_line[0] << " ..."; |
| 354 } | 356 } |
| 355 #endif | 357 #endif |
| 356 | 358 |
| 357 virtual bool MakeGETRequest(const std::string& page_name) = 0; | 359 virtual bool MakeGETRequest(const std::string& page_name) = 0; |
| 358 | 360 |
| 359 // Verify that the Server is actually started. | 361 // Verify that the Server is actually started. |
| 360 // Otherwise tests can fail if they run faster than Python can start. | 362 // Otherwise tests can fail if they run faster than Python can start. |
| 361 bool VerifyLaunchApp(const std::string& page_name) { | 363 bool VerifyLaunchApp(const std::string& page_name) { |
| 362 int retries = 10; | 364 int retries = 10; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 command_line->push_back("python"); | 679 command_line->push_back("python"); |
| 678 command_line->push_back(WideToUTF8(testserver_path)); | 680 command_line->push_back(WideToUTF8(testserver_path)); |
| 679 command_line->push_back(" -f "); | 681 command_line->push_back(" -f "); |
| 680 command_line->push_back("--data-dir=" + WideToUTF8(test_data_directory)); | 682 command_line->push_back("--data-dir=" + WideToUTF8(test_data_directory)); |
| 681 command_line->push_back("--port=" + port_str_); | 683 command_line->push_back("--port=" + port_str_); |
| 682 } | 684 } |
| 683 #endif | 685 #endif |
| 684 }; | 686 }; |
| 685 | 687 |
| 686 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 688 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| OLD | NEW |