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

Unified Diff: blimp/net/blimp_connection_unittest.cc

Issue 1909143002: Use ConnectionErrorObserver, not callbacks, for error handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed haibinlu feedback. Created 4 years, 7 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_output_buffer.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 59c7a39a370f218e2a17c58283f87dd14d19822b..9b5d24695ef11407d06946fba5f53d4f4540e93f 100644
--- a/blimp/net/blimp_connection_unittest.cc
+++ b/blimp/net/blimp_connection_unittest.cc
@@ -46,6 +46,8 @@ class BlimpConnectionTest : public testing::Test {
~BlimpConnectionTest() override {}
+ void DropConnection() { connection_.reset(); }
+
protected:
std::unique_ptr<BlimpMessage> CreateInputMessage() {
std::unique_ptr<BlimpMessage> msg(new BlimpMessage);
@@ -119,7 +121,9 @@ TEST_F(BlimpConnectionTest, AsyncTwoPacketsWriteWithError) {
.WillOnce(SaveArg<1>(&write_packet_cb))
.RetiresOnSaturation();
EXPECT_CALL(error_observer1_, OnConnectionError(net::ERR_FAILED));
- EXPECT_CALL(error_observer2_, OnConnectionError(net::ERR_FAILED));
+ EXPECT_CALL(error_observer2_, OnConnectionError(net::ERR_FAILED))
+ .WillOnce(testing::InvokeWithoutArgs(
+ this, &BlimpConnectionTest::DropConnection));
Wez 2016/05/25 03:28:35 You don't want to add a separate, dedicated test?
Kevin M 2016/05/25 20:40:25 Done.
BlimpMessageProcessor* sender = connection_->GetOutgoingMessageProcessor();
net::TestCompletionCallback complete_cb_1;
« no previous file with comments | « blimp/net/blimp_connection.cc ('k') | blimp/net/blimp_message_output_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698