| 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 #include "chrome/test/automation/proxy_launcher.h" | 5 #include "chrome/test/automation/proxy_launcher.h" |
| 6 | 6 |
| 7 #include <vector> |
| 8 |
| 7 #include "base/environment.h" | 9 #include "base/environment.h" |
| 8 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 9 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 12 #include "base/string_split.h" |
| 11 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 12 #include "base/test/test_file_util.h" | 14 #include "base/test/test_file_util.h" |
| 13 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
| 14 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 16 #include "chrome/common/automation_constants.h" | 18 #include "chrome/common/automation_constants.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 browser_launch_time_ = base::TimeTicks::Now(); | 471 browser_launch_time_ = base::TimeTicks::Now(); |
| 470 | 472 |
| 471 base::LaunchOptions options; | 473 base::LaunchOptions options; |
| 472 options.wait = wait; | 474 options.wait = wait; |
| 473 | 475 |
| 474 #if defined(OS_WIN) | 476 #if defined(OS_WIN) |
| 475 options.start_hidden = !state.show_window; | 477 options.start_hidden = !state.show_window; |
| 476 #elif defined(OS_POSIX) | 478 #elif defined(OS_POSIX) |
| 477 int ipcfd = -1; | 479 int ipcfd = -1; |
| 478 file_util::ScopedFD ipcfd_closer(&ipcfd); | 480 file_util::ScopedFD ipcfd_closer(&ipcfd); |
| 479 base::file_handle_mapping_vector fds; | 481 base::FileHandleMappingVector fds; |
| 480 if (main_launch && automation_proxy_.get()) { | 482 if (main_launch && automation_proxy_.get()) { |
| 481 ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor(); | 483 ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor(); |
| 482 fds.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3)); | 484 fds.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3)); |
| 483 options.fds_to_remap = &fds; | 485 options.fds_to_remap = &fds; |
| 484 } | 486 } |
| 485 #endif | 487 #endif |
| 486 | 488 |
| 487 return base::LaunchProcess(command_line, options, process); | 489 return base::LaunchProcess(command_line, options, process); |
| 488 } | 490 } |
| 489 | 491 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 return LaunchBrowserAndServer(state, wait_for_initial_loads); | 607 return LaunchBrowserAndServer(state, wait_for_initial_loads); |
| 606 } | 608 } |
| 607 | 609 |
| 608 void AnonymousProxyLauncher::TerminateConnection() { | 610 void AnonymousProxyLauncher::TerminateConnection() { |
| 609 CloseBrowserAndServer(); | 611 CloseBrowserAndServer(); |
| 610 } | 612 } |
| 611 | 613 |
| 612 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 614 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
| 613 return channel_id_; | 615 return channel_id_; |
| 614 } | 616 } |
| OLD | NEW |