From b6be588e0c3d01b785ae04eef177b2f1e6526f28 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Fri, 7 Nov 2008 21:53:03 +0000 Subject: Fix a failure on the ipc_tests due to a race between closing the ipc channel and sending the last message. Sometimes that last write is cancelled so there will be a channel error at the other end. Review URL: http://codereview.chromium.org/9629 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5022 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/ipc_tests.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'chrome/common') diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc index 9afbc67..3b73de9 100644 --- a/chrome/common/ipc_tests.cc +++ b/chrome/common/ipc_tests.cc @@ -99,6 +99,12 @@ class MyChannelListener : public IPC::Channel::Listener { } } + virtual void OnChannelError() { + // There is a race when closing the channel so the last message may be lost. + EXPECT_LE(messages_left_, 1); + MessageLoop::current()->Quit(); + } + void Init(IPC::Message::Sender* s) { sender_ = s; messages_left_ = 50; -- cgit v1.1