summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 21:53:03 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 21:53:03 +0000
commitb6be588e0c3d01b785ae04eef177b2f1e6526f28 (patch)
tree46bd16f7d0b2be5fd83de8f50469878561c8a5ae /chrome/common
parent17b891482a081341470ead21ca7eda953d74dd69 (diff)
downloadchromium_src-b6be588e0c3d01b785ae04eef177b2f1e6526f28.zip
chromium_src-b6be588e0c3d01b785ae04eef177b2f1e6526f28.tar.gz
chromium_src-b6be588e0c3d01b785ae04eef177b2f1e6526f28.tar.bz2
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
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/ipc_tests.cc6
1 files changed, 6 insertions, 0 deletions
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;