OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // These tests are POSIX only. | 5 // These tests are POSIX only. |
6 | 6 |
7 #include "ipc/ipc_channel_posix.h" | 7 #include "ipc/ipc_channel_posix.h" |
8 | 8 |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 class IPCChannelPosixTest : public base::MultiProcessTest { | 103 class IPCChannelPosixTest : public base::MultiProcessTest { |
104 public: | 104 public: |
105 static void SetUpSocket(IPC::ChannelHandle *handle, | 105 static void SetUpSocket(IPC::ChannelHandle *handle, |
106 IPC::Channel::Mode mode); | 106 IPC::Channel::Mode mode); |
107 static void SpinRunLoop(base::TimeDelta delay); | 107 static void SpinRunLoop(base::TimeDelta delay); |
108 static const std::string GetConnectionSocketName(); | 108 static const std::string GetConnectionSocketName(); |
109 static const std::string GetChannelDirName(); | 109 static const std::string GetChannelDirName(); |
110 | 110 |
111 protected: | 111 protected: |
112 virtual void SetUp(); | 112 void SetUp() override; |
113 virtual void TearDown(); | 113 void TearDown() override; |
114 | 114 |
115 private: | 115 private: |
116 scoped_ptr<base::MessageLoopForIO> message_loop_; | 116 scoped_ptr<base::MessageLoopForIO> message_loop_; |
117 }; | 117 }; |
118 | 118 |
119 const std::string IPCChannelPosixTest::GetChannelDirName() { | 119 const std::string IPCChannelPosixTest::GetChannelDirName() { |
120 #if defined(OS_ANDROID) | 120 #if defined(OS_ANDROID) |
121 base::FilePath tmp_dir; | 121 base::FilePath tmp_dir; |
122 PathService::Get(base::DIR_CACHE, &tmp_dir); | 122 PathService::Get(base::DIR_CACHE, &tmp_dir); |
123 return tmp_dir.value(); | 123 return tmp_dir.value(); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 if (connected) { | 477 if (connected) { |
478 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); | 478 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); |
479 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); | 479 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); |
480 } else { | 480 } else { |
481 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); | 481 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); |
482 } | 482 } |
483 return 0; | 483 return 0; |
484 } | 484 } |
485 | 485 |
486 } // namespace | 486 } // namespace |
OLD | NEW |