Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: ipc/mojo/ipc_channel_mojo_unittest.cc

Issue 453643003: IPC::ChannelMojo: Don't supress MOJO_RESULT_FAILED_PRECONDITION (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ipc/mojo/ipc_message_pipe_reader.cc » ('j') | ipc/mojo/ipc_message_pipe_reader.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo_unittest.cc
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index 915029df56ffbfa3cd3de81c6276e0e579d74115..31578370399034a094fc188bc1bbe165181e7e1c 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -22,7 +22,8 @@ namespace {
class ListenerThatExpectsOK : public IPC::Listener {
public:
- ListenerThatExpectsOK() {}
+ ListenerThatExpectsOK()
+ : received_ok_(false) {}
virtual ~ListenerThatExpectsOK() {}
@@ -31,12 +32,16 @@ class ListenerThatExpectsOK : public IPC::Listener {
std::string should_be_ok;
EXPECT_TRUE(iter.ReadString(&should_be_ok));
EXPECT_EQ(should_be_ok, "OK");
+ received_ok_ = true;
base::MessageLoop::current()->Quit();
return true;
}
virtual void OnChannelError() OVERRIDE {
- NOTREACHED();
+ // The connection should be healthy while the listener is waiting
+ // message. An error can occur after that because the peer
+ // process dies.
+ DCHECK(received_ok_);
}
static void SendOK(IPC::Sender* sender) {
@@ -45,6 +50,9 @@ class ListenerThatExpectsOK : public IPC::Listener {
message->WriteString(std::string("OK"));
ASSERT_TRUE(sender->Send(message));
}
+
+ private:
+ bool received_ok_;
};
class ListenerThatShouldBeNeverCalled : public IPC::Listener {
« no previous file with comments | « no previous file | ipc/mojo/ipc_message_pipe_reader.cc » ('j') | ipc/mojo/ipc_message_pipe_reader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698