From d8b65915b2181a863611254c3cefb966103386f3 Mon Sep 17 00:00:00 2001 From: "cpu@chromium.org" Date: Fri, 4 Dec 2009 22:53:22 +0000 Subject: Add non-blocking peek for the syncsocket - Windows only BUG=none TEST=unit test included Review URL: http://codereview.chromium.org/464020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33876 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/sync_socket_unittest.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ipc') diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc index 9820009..7710c09 100644 --- a/ipc/sync_socket_unittest.cc +++ b/ipc/sync_socket_unittest.cc @@ -189,6 +189,11 @@ class SyncSocketClientListener : public IPC::Channel::Listener { // string as was written on the SyncSocket. These are compared // and a shutdown message is sent back to the server. void OnMsgClassResponse(const std::string& str) { +#if defined(OS_WIN) + // We rely on the order of sync_socket.Send() and chan_->Send() in + // the SyncSocketServerListener object. + EXPECT_EQ(kHelloStringLength, socket_->Peek()); +#endif char buf[kHelloStringLength]; socket_->Receive(static_cast(buf), kHelloStringLength); EXPECT_EQ(strcmp(str.c_str(), buf), 0); -- cgit v1.1