OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 219 |
220 // Takes ownership of |broker|. Has no effect if called after CommonSetUp(). | 220 // Takes ownership of |broker|. Has no effect if called after CommonSetUp(). |
221 void set_broker(IPC::AttachmentBrokerUnprivilegedWin* broker) { | 221 void set_broker(IPC::AttachmentBrokerUnprivilegedWin* broker) { |
222 broker_.reset(broker); | 222 broker_.reset(broker); |
223 } | 223 } |
224 | 224 |
225 void CommonSetUp() { | 225 void CommonSetUp() { |
226 if (!broker_.get()) | 226 if (!broker_.get()) |
227 set_broker(new IPC::AttachmentBrokerUnprivilegedWin); | 227 set_broker(new IPC::AttachmentBrokerUnprivilegedWin); |
228 broker_->AddObserver(&observer_); | 228 broker_->AddObserver(&observer_); |
229 set_attachment_broker(broker_.get()); | |
230 CreateChannel(&proxy_listener_); | 229 CreateChannel(&proxy_listener_); |
231 broker_->DesignateBrokerCommunicationChannel(channel()); | 230 broker_->DesignateBrokerCommunicationChannel(channel()); |
232 ASSERT_TRUE(ConnectChannel()); | 231 ASSERT_TRUE(ConnectChannel()); |
233 ASSERT_TRUE(StartClient()); | 232 ASSERT_TRUE(StartClient()); |
234 } | 233 } |
235 | 234 |
236 void CommonTearDown() { | 235 void CommonTearDown() { |
237 // Close the channel so the client's OnChannelError() gets fired. | 236 // Close the channel so the client's OnChannelError() gets fired. |
238 channel()->Close(); | 237 channel()->Close(); |
239 | 238 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 SendControlMessage(sender, success); | 552 SendControlMessage(sender, success); |
554 } | 553 } |
555 } | 554 } |
556 | 555 |
557 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleTwice) { | 556 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleTwice) { |
558 return CommonPrivilegedProcessMain(&SendHandleTwiceCallback, | 557 return CommonPrivilegedProcessMain(&SendHandleTwiceCallback, |
559 "SendHandleTwice"); | 558 "SendHandleTwice"); |
560 } | 559 } |
561 | 560 |
562 } // namespace | 561 } // namespace |
OLD | NEW |