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

Unified Diff: blimp/net/blimp_connection_unittest.cc

Issue 1551583003: Implementation and fixes for Blimp client/engine E2E communication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dtrainor-linux-cl1528243002
Patch Set: Fixed misplaced EXPORT directive Created 4 years, 12 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 | « blimp/net/blimp_connection.cc ('k') | blimp/net/blimp_message_demultiplexer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/blimp_connection_unittest.cc
diff --git a/blimp/net/blimp_connection_unittest.cc b/blimp/net/blimp_connection_unittest.cc
index 8816b14fdd37492e9fefb6e4298c3c58a56a9f2f..ad55a2c96d14ca6c6249bd80bf698d4ee590dc83 100644
--- a/blimp/net/blimp_connection_unittest.cc
+++ b/blimp/net/blimp_connection_unittest.cc
@@ -35,7 +35,10 @@ class BlimpConnectionTest : public testing::Test {
writer_ = writer.get();
connection_.reset(new BlimpConnection(make_scoped_ptr(new MockPacketReader),
std::move(writer)));
- connection_->SetConnectionErrorObserver(&error_observer_);
+ connection_->AddConnectionErrorObserver(&error_observer1_);
+ connection_->AddConnectionErrorObserver(&error_observer2_);
+ connection_->AddConnectionErrorObserver(&error_observer3_);
+ connection_->RemoveConnectionErrorObserver(&error_observer3_);
}
~BlimpConnectionTest() override {}
@@ -55,7 +58,13 @@ class BlimpConnectionTest : public testing::Test {
base::MessageLoop message_loop_;
testing::StrictMock<MockPacketWriter>* writer_;
- testing::StrictMock<MockConnectionErrorObserver> error_observer_;
+ testing::StrictMock<MockConnectionErrorObserver> error_observer1_;
+ testing::StrictMock<MockConnectionErrorObserver> error_observer2_;
+
+ // This error observer is Removed() immediately after it's added;
+ // it should never be called.
+ testing::StrictMock<MockConnectionErrorObserver> error_observer3_;
+
testing::StrictMock<MockBlimpMessageProcessor> receiver_;
scoped_ptr<BlimpConnection> connection_;
};
@@ -106,7 +115,8 @@ TEST_F(BlimpConnectionTest, AsyncTwoPacketsWriteWithError) {
WritePacket(BufferEqualsProto(*CreateControlMessage()), _))
.WillOnce(SaveArg<1>(&write_packet_cb))
.RetiresOnSaturation();
- EXPECT_CALL(error_observer_, OnConnectionError(net::ERR_FAILED));
+ EXPECT_CALL(error_observer1_, OnConnectionError(net::ERR_FAILED));
+ EXPECT_CALL(error_observer2_, OnConnectionError(net::ERR_FAILED));
BlimpMessageProcessor* sender = connection_->GetOutgoingMessageProcessor();
net::TestCompletionCallback complete_cb_1;
« no previous file with comments | « blimp/net/blimp_connection.cc ('k') | blimp/net/blimp_message_demultiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698