| 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> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/test/base/test_launcher_utils.h" | 28 #include "chrome/test/base/test_launcher_utils.h" |
| 29 #include "chrome/test/base/test_switches.h" | 29 #include "chrome/test/base/test_switches.h" |
| 30 #include "chrome/test/ui/ui_test.h" | 30 #include "chrome/test/ui/ui_test.h" |
| 31 #include "content/public/common/process_type.h" | 31 #include "content/public/common/process_type.h" |
| 32 #include "ipc/ipc_channel.h" | 32 #include "ipc/ipc_channel.h" |
| 33 #include "ipc/ipc_descriptors.h" | 33 #include "ipc/ipc_descriptors.h" |
| 34 #include "sql/connection.h" | 34 #include "sql/connection.h" |
| 35 | 35 |
| 36 #if defined(OS_POSIX) | 36 #if defined(OS_POSIX) |
| 37 #include <signal.h> | 37 #include <signal.h> |
| 38 #include "base/posix/global_descriptors.h" |
| 38 #endif | 39 #endif |
| 39 | 40 |
| 40 namespace { | 41 namespace { |
| 41 | 42 |
| 42 // Passed as value of kTestType. | 43 // Passed as value of kTestType. |
| 43 const char kUITestType[] = "ui"; | 44 const char kUITestType[] = "ui"; |
| 44 | 45 |
| 45 // Copies the contents of the given source directory to the given dest | 46 // Copies the contents of the given source directory to the given dest |
| 46 // directory. This is somewhat different than CopyDirectory in base which will | 47 // directory. This is somewhat different than CopyDirectory in base which will |
| 47 // copies "source/" to "dest/source/". This version will copy "source/*" to | 48 // copies "source/" to "dest/source/". This version will copy "source/*" to |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 options.wait = wait; | 497 options.wait = wait; |
| 497 | 498 |
| 498 #if defined(OS_WIN) | 499 #if defined(OS_WIN) |
| 499 options.start_hidden = !state.show_window; | 500 options.start_hidden = !state.show_window; |
| 500 #elif defined(OS_POSIX) | 501 #elif defined(OS_POSIX) |
| 501 int ipcfd = -1; | 502 int ipcfd = -1; |
| 502 file_util::ScopedFD ipcfd_closer(&ipcfd); | 503 file_util::ScopedFD ipcfd_closer(&ipcfd); |
| 503 base::FileHandleMappingVector fds; | 504 base::FileHandleMappingVector fds; |
| 504 if (main_launch && automation_proxy_.get()) { | 505 if (main_launch && automation_proxy_.get()) { |
| 505 ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor(); | 506 ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor(); |
| 506 fds.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3)); | 507 fds.push_back(std::make_pair(ipcfd, |
| 508 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); |
| 507 options.fds_to_remap = &fds; | 509 options.fds_to_remap = &fds; |
| 508 } | 510 } |
| 509 #endif | 511 #endif |
| 510 | 512 |
| 511 return base::LaunchProcess(command_line, options, process); | 513 return base::LaunchProcess(command_line, options, process); |
| 512 } | 514 } |
| 513 | 515 |
| 514 AutomationProxy* ProxyLauncher::automation() const { | 516 AutomationProxy* ProxyLauncher::automation() const { |
| 515 EXPECT_TRUE(automation_proxy_.get()); | 517 EXPECT_TRUE(automation_proxy_.get()); |
| 516 return automation_proxy_.get(); | 518 return automation_proxy_.get(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 return LaunchBrowserAndServer(state, wait_for_initial_loads); | 632 return LaunchBrowserAndServer(state, wait_for_initial_loads); |
| 631 } | 633 } |
| 632 | 634 |
| 633 void AnonymousProxyLauncher::TerminateConnection() { | 635 void AnonymousProxyLauncher::TerminateConnection() { |
| 634 CloseBrowserAndServer(); | 636 CloseBrowserAndServer(); |
| 635 } | 637 } |
| 636 | 638 |
| 637 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 639 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
| 638 return channel_id_; | 640 return channel_id_; |
| 639 } | 641 } |
| OLD | NEW |