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
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 @@
   // 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<void*>(buf), kHelloStringLength);
     EXPECT_EQ(strcmp(str.c_str(), buf), 0);