OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/importer/firefox_importer_unittest_utils.h" | 5 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 base::file_handle_mapping_vector fds_to_map; | 46 base::file_handle_mapping_vector fds_to_map; |
47 const int ipcfd = channel.GetClientFileDescriptor(); | 47 const int ipcfd = channel.GetClientFileDescriptor(); |
48 if (ipcfd > -1) { | 48 if (ipcfd > -1) { |
49 fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3)); | 49 fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3)); |
50 } else { | 50 } else { |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( | 54 bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( |
55 switches::kDebugChildren); | 55 switches::kDebugChildren); |
56 return base::LaunchApp(cl.argv(), env, fds_to_map, debug_on_start, handle); | 56 base::LaunchOptions options; |
| 57 options.environ = &env; |
| 58 options.fds_to_remap = &fds_to_map; |
| 59 options.wait = debug_on_start; |
| 60 options.process_handle = handle; |
| 61 return base::LaunchProcess(cl.argv(), options); |
57 } | 62 } |
58 | 63 |
59 } // namespace | 64 } // namespace |
60 | 65 |
61 //----------------------- Server -------------------- | 66 //----------------------- Server -------------------- |
62 | 67 |
63 // Class to communicate on the server side of the IPC Channel. | 68 // Class to communicate on the server side of the IPC Channel. |
64 // Method calls are sent over IPC and replies are read back into class | 69 // Method calls are sent over IPC and replies are read back into class |
65 // variables. | 70 // variables. |
66 // This class needs to be called on a single thread. | 71 // This class needs to be called on a single thread. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 264 |
260 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); | 265 IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); |
261 CHECK(channel.Connect()); | 266 CHECK(channel.Connect()); |
262 listener.SetSender(&channel); | 267 listener.SetSender(&channel); |
263 | 268 |
264 // run message loop | 269 // run message loop |
265 MessageLoop::current()->Run(); | 270 MessageLoop::current()->Run(); |
266 | 271 |
267 return 0; | 272 return 0; |
268 } | 273 } |
OLD | NEW |