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

Unified Diff: ipc/ipc_channel_proxy_unittest.cc

Issue 2437283005: Fix some test expectations for IPC tests (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy_unittest.cc
diff --git a/ipc/ipc_channel_proxy_unittest.cc b/ipc/ipc_channel_proxy_unittest.cc
index 59e51b3075e17f023f7fcb3a7bca8e7ff1c59b89..8f31e85d0651453a704fe6a6ec7fe3bd9902629f 100644
--- a/ipc/ipc_channel_proxy_unittest.cc
+++ b/ipc/ipc_channel_proxy_unittest.cc
@@ -165,17 +165,18 @@ class MessageCountFilter : public IPC::MessageFilter {
void OnChannelClosing() override {
// We may or may not have gotten OnChannelError; if not, the last event has
// to be OnChannelConnected.
+ EXPECT_NE(FILTER_REMOVED, last_filter_event_);
if (last_filter_event_ != CHANNEL_ERROR)
EXPECT_EQ(CHANNEL_CONNECTED, last_filter_event_);
last_filter_event_ = CHANNEL_CLOSING;
}
void OnFilterRemoved() override {
- // If the channel didn't get a chance to connect, we might see the
- // OnFilterRemoved event with no other events preceding it. We still want
- // OnFilterRemoved to be called to allow for deleting the Filter.
- if (last_filter_event_ != NONE)
- EXPECT_EQ(CHANNEL_CLOSING, last_filter_event_);
+ // A filter may be removed at any time, even before the channel is connected
+ // (and thus before OnFilterAdded is ever able to dispatch.) The only time
+ // we won't see OnFilterRemoved is immediately after OnFilterAdded, because
+ // OnChannelConnected is always the next event to fire after that.
+ EXPECT_NE(FILTER_ADDED, last_filter_event_);
last_filter_event_ = FILTER_REMOVED;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698