| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 // The current status of the listener. | 88 // The current status of the listener. |
| 89 STATUS status_; | 89 STATUS status_; |
| 90 // If |quit_only_on_message_| then the listener will only break out of | 90 // If |quit_only_on_message_| then the listener will only break out of |
| 91 // the run loop when kQuitMessage is received. | 91 // the run loop when kQuitMessage is received. |
| 92 bool quit_only_on_message_; | 92 bool quit_only_on_message_; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace | |
| 96 | |
| 97 class IPCChannelPosixTest : public base::MultiProcessTest { | 95 class IPCChannelPosixTest : public base::MultiProcessTest { |
| 98 public: | 96 public: |
| 99 static void SetUpSocket(IPC::ChannelHandle *handle, | 97 static void SetUpSocket(IPC::ChannelHandle *handle, |
| 100 IPC::Channel::Mode mode); | 98 IPC::Channel::Mode mode); |
| 101 static void SpinRunLoop(base::TimeDelta delay); | 99 static void SpinRunLoop(base::TimeDelta delay); |
| 102 static const std::string GetConnectionSocketName(); | 100 static const std::string GetConnectionSocketName(); |
| 103 static const std::string GetChannelDirName(); | 101 static const std::string GetChannelDirName(); |
| 104 | 102 |
| 105 protected: | 103 protected: |
| 106 virtual void SetUp(); | 104 virtual void SetUp(); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // it. | 416 // it. |
| 419 bool connected = channel.Connect(); | 417 bool connected = channel.Connect(); |
| 420 if (connected) { | 418 if (connected) { |
| 421 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); | 419 IPCChannelPosixTest::SpinRunLoop(TestTimeouts::action_max_timeout()); |
| 422 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); | 420 EXPECT_EQ(IPCChannelPosixTestListener::CHANNEL_ERROR, listener.status()); |
| 423 } else { | 421 } else { |
| 424 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); | 422 EXPECT_EQ(IPCChannelPosixTestListener::DISCONNECTED, listener.status()); |
| 425 } | 423 } |
| 426 return 0; | 424 return 0; |
| 427 } | 425 } |
| 426 |
| 427 } // namespace |
| OLD | NEW |