Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: ipc/attachment_broker_privileged_win_unittest.cc

Issue 1270683002: ipc: Make a common subclass for Channel and ProxyChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/attachment_broker_privileged_win.cc ('k') | ipc/attachment_broker_unprivileged.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // Similar to SendHandle, except the attachment's destination process is this 273 // Similar to SendHandle, except the attachment's destination process is this
274 // process. This is an unrealistic scenario, but simulates an unprivileged 274 // process. This is an unrealistic scenario, but simulates an unprivileged
275 // process sending an attachment to another unprivileged process. 275 // process sending an attachment to another unprivileged process.
276 TEST_F(IPCAttachmentBrokerPrivilegedWinTest, SendHandleToSelf) { 276 TEST_F(IPCAttachmentBrokerPrivilegedWinTest, SendHandleToSelf) {
277 Init("SendHandleToSelf"); 277 Init("SendHandleToSelf");
278 278
279 set_broker(new MockBroker); 279 set_broker(new MockBroker);
280 CommonSetUp(); 280 CommonSetUp();
281 // Technically, the channel is an endpoint, but we need the proxy listener to 281 // Technically, the channel is an endpoint, but we need the proxy listener to
282 // receive the messages so that it can quit the message loop. 282 // receive the messages so that it can quit the message loop.
283 channel()->set_attachment_broker_endpoint(false); 283 channel()->SetAttachmentBrokerEndpoint(false);
284 get_proxy_listener()->set_listener(get_broker()); 284 get_proxy_listener()->set_listener(get_broker());
285 285
286 HANDLE h = CreateTempFile(); 286 HANDLE h = CreateTempFile();
287 SendMessageWithAttachment(h); 287 SendMessageWithAttachment(h);
288 base::MessageLoop::current()->Run(); 288 base::MessageLoop::current()->Run();
289 289
290 // Get the received attachment. 290 // Get the received attachment.
291 IPC::BrokerableAttachment::AttachmentId* id = get_observer()->get_id(); 291 IPC::BrokerableAttachment::AttachmentId* id = get_observer()->get_id();
292 scoped_refptr<IPC::BrokerableAttachment> received_attachment; 292 scoped_refptr<IPC::BrokerableAttachment> received_attachment;
293 get_broker()->GetAttachmentWithId(*id, &received_attachment); 293 get_broker()->GetAttachmentWithId(*id, &received_attachment);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // Do nothing special. The default behavior already runs the 393 // Do nothing special. The default behavior already runs the
394 // AttachmentBrokerPrivilegedWin. 394 // AttachmentBrokerPrivilegedWin.
395 } 395 }
396 396
397 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleToSelf) { 397 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleToSelf) {
398 return CommonPrivilegedProcessMain(&SendHandleToSelfCallback, 398 return CommonPrivilegedProcessMain(&SendHandleToSelfCallback,
399 "SendHandleToSelf"); 399 "SendHandleToSelf");
400 } 400 }
401 401
402 } // namespace 402 } // namespace
OLDNEW
« no previous file with comments | « ipc/attachment_broker_privileged_win.cc ('k') | ipc/attachment_broker_unprivileged.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698