summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream.cc3
-rw-r--r--net/socket_stream/socket_stream_unittest.cc12
2 files changed, 6 insertions, 9 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 84b58bc..a9df840 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -359,7 +359,8 @@ void SocketStream::Finish(int result) {
Delegate* delegate = delegate_;
delegate_ = NULL;
if (delegate) {
- delegate->OnError(this, result);
+ if (result != ERR_CONNECTION_CLOSED)
+ delegate->OnError(this, result);
if (result != ERR_PROTOCOL_SWITCHED)
delegate->OnClose(this);
}
diff --git a/net/socket_stream/socket_stream_unittest.cc b/net/socket_stream/socket_stream_unittest.cc
index e98e0df..b0734fc 100644
--- a/net/socket_stream/socket_stream_unittest.cc
+++ b/net/socket_stream/socket_stream_unittest.cc
@@ -356,7 +356,7 @@ TEST_F(SocketStreamTest, CloseFlushPendingWrite) {
test_callback.WaitForResult();
const std::vector<SocketStreamEvent>& events = delegate->GetSeenEvents();
- ASSERT_EQ(8U, events.size());
+ ASSERT_EQ(7U, events.size());
EXPECT_EQ(SocketStreamEvent::EVENT_START_OPEN_CONNECTION,
events[0].event_type);
@@ -365,9 +365,7 @@ TEST_F(SocketStreamTest, CloseFlushPendingWrite) {
EXPECT_EQ(SocketStreamEvent::EVENT_RECEIVED_DATA, events[3].event_type);
EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[4].event_type);
EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[5].event_type);
- EXPECT_EQ(SocketStreamEvent::EVENT_ERROR, events[6].event_type);
- EXPECT_EQ(ERR_CONNECTION_CLOSED, events[6].error_code);
- EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[7].event_type);
+ EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[6].event_type);
}
TEST_F(SocketStreamTest, ExceedMaxPendingSendAllowed) {
@@ -645,7 +643,7 @@ TEST_F(SocketStreamTest, IOPending) {
EXPECT_EQ(OK, test_callback.WaitForResult());
const std::vector<SocketStreamEvent>& events = delegate->GetSeenEvents();
- ASSERT_EQ(8U, events.size());
+ ASSERT_EQ(7U, events.size());
EXPECT_EQ(SocketStreamEvent::EVENT_START_OPEN_CONNECTION,
events[0].event_type);
@@ -654,9 +652,7 @@ TEST_F(SocketStreamTest, IOPending) {
EXPECT_EQ(SocketStreamEvent::EVENT_RECEIVED_DATA, events[3].event_type);
EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[4].event_type);
EXPECT_EQ(SocketStreamEvent::EVENT_SENT_DATA, events[5].event_type);
- EXPECT_EQ(SocketStreamEvent::EVENT_ERROR, events[6].event_type);
- EXPECT_EQ(ERR_CONNECTION_CLOSED, events[6].error_code);
- EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[7].event_type);
+ EXPECT_EQ(SocketStreamEvent::EVENT_CLOSE, events[6].event_type);
}
TEST_F(SocketStreamTest, SwitchToSpdy) {