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

Unified Diff: ipc/attachment_broker_privileged_win_unittest.cc

Issue 1903663004: IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (scoped_ptr->std::unique_ptr) Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/attachment_broker_mac_unittest.cc ('k') | ipc/ipc_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_privileged_win_unittest.cc
diff --git a/ipc/attachment_broker_privileged_win_unittest.cc b/ipc/attachment_broker_privileged_win_unittest.cc
index dc3bffc14e05db2938066512f7bc7f8244e628e7..3c8df8e806468a4ec53c1a5095ab728ad6901bc3 100644
--- a/ipc/attachment_broker_privileged_win_unittest.cc
+++ b/ipc/attachment_broker_privileged_win_unittest.cc
@@ -265,11 +265,21 @@ class IPCAttachmentBrokerPrivilegedWinTest : public IPCTestBase {
}
void CommonSetUp() {
+ PreConnectSetUp();
+ PostConnectSetUp();
+ }
+
+ // All of setup before the channel is connected.
+ void PreConnectSetUp() {
if (!broker_.get())
set_broker(new IPC::AttachmentBrokerUnprivilegedWin);
broker_->AddObserver(&observer_, task_runner());
CreateChannel(&proxy_listener_);
broker_->RegisterBrokerCommunicationChannel(channel());
+ }
+
+ // All of setup including the connection and everything after.
+ void PostConnectSetUp() {
ASSERT_TRUE(ConnectChannel());
ASSERT_TRUE(StartClient());
@@ -390,10 +400,12 @@ TEST_F(IPCAttachmentBrokerPrivilegedWinTest, SendHandleToSelf) {
Init("SendHandleToSelf");
set_broker(new MockBroker);
- CommonSetUp();
+
+ PreConnectSetUp();
// Technically, the channel is an endpoint, but we need the proxy listener to
// receive the messages so that it can quit the message loop.
channel()->SetAttachmentBrokerEndpoint(false);
+ PostConnectSetUp();
get_proxy_listener()->set_listener(get_broker());
HANDLE h = CreateTempFile();
« no previous file with comments | « ipc/attachment_broker_mac_unittest.cc ('k') | ipc/ipc_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698