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

Side by Side Diff: ipc/mojo/ipc_mojo_bootstrap_unittest.cc

Issue 1354973006: ipc: Remove unnecessary attachment broker plumbing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile errors. Created 5 years, 2 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/mojo/ipc_mojo_bootstrap.cc ('k') | ipc/mojo/ipc_mojo_perftest.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/mojo/ipc_mojo_bootstrap.h" 5 #include "ipc/mojo/ipc_mojo_bootstrap.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ipc/ipc_test_base.h" 10 #include "ipc/ipc_test_base.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #if defined(OS_ANDROID) 46 #if defined(OS_ANDROID)
47 #define MAYBE_Connect DISABLED_Connect 47 #define MAYBE_Connect DISABLED_Connect
48 #else 48 #else
49 #define MAYBE_Connect Connect 49 #define MAYBE_Connect Connect
50 #endif 50 #endif
51 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) { 51 TEST_F(IPCMojoBootstrapTest, MAYBE_Connect) {
52 Init("IPCMojoBootstrapTestClient"); 52 Init("IPCMojoBootstrapTestClient");
53 53
54 TestingDelegate delegate; 54 TestingDelegate delegate;
55 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( 55 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create(
56 GetTestChannelHandle(), IPC::Channel::MODE_SERVER, &delegate, nullptr); 56 GetTestChannelHandle(), IPC::Channel::MODE_SERVER, &delegate);
57 57
58 ASSERT_TRUE(bootstrap->Connect()); 58 ASSERT_TRUE(bootstrap->Connect());
59 #if defined(OS_POSIX) 59 #if defined(OS_POSIX)
60 ASSERT_TRUE(StartClientWithFD(bootstrap->GetClientFileDescriptor())); 60 ASSERT_TRUE(StartClientWithFD(bootstrap->GetClientFileDescriptor()));
61 #else 61 #else
62 ASSERT_TRUE(StartClient()); 62 ASSERT_TRUE(StartClient());
63 #endif 63 #endif
64 64
65 base::MessageLoop::current()->Run(); 65 base::MessageLoop::current()->Run();
66 66
67 EXPECT_TRUE(delegate.passed()); 67 EXPECT_TRUE(delegate.passed());
68 EXPECT_TRUE(WaitForClientShutdown()); 68 EXPECT_TRUE(WaitForClientShutdown());
69 } 69 }
70 70
71 // A long running process that connects to us. 71 // A long running process that connects to us.
72 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(IPCMojoBootstrapTestClient) { 72 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(IPCMojoBootstrapTestClient) {
73 base::MessageLoopForIO main_message_loop; 73 base::MessageLoopForIO main_message_loop;
74 74
75 TestingDelegate delegate; 75 TestingDelegate delegate;
76 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create( 76 scoped_ptr<IPC::MojoBootstrap> bootstrap = IPC::MojoBootstrap::Create(
77 IPCTestBase::GetChannelName("IPCMojoBootstrapTestClient"), 77 IPCTestBase::GetChannelName("IPCMojoBootstrapTestClient"),
78 IPC::Channel::MODE_CLIENT, &delegate, nullptr); 78 IPC::Channel::MODE_CLIENT, &delegate);
79 79
80 bootstrap->Connect(); 80 bootstrap->Connect();
81 81
82 base::MessageLoop::current()->Run(); 82 base::MessageLoop::current()->Run();
83 83
84 EXPECT_TRUE(delegate.passed()); 84 EXPECT_TRUE(delegate.passed());
85 85
86 return 0; 86 return 0;
87 } 87 }
88 88
89 } // namespace 89 } // namespace
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_mojo_bootstrap.cc ('k') | ipc/mojo/ipc_mojo_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698