Index: content/browser/byte_stream_unittest.cc |
diff --git a/content/browser/byte_stream_unittest.cc b/content/browser/byte_stream_unittest.cc |
index 04c5ae3753306b721a80dd7575309955b3156001..3d902bb7afd9a1fa0806fb791725ac4dd18b13e0 100644 |
--- a/content/browser/byte_stream_unittest.cc |
+++ b/content/browser/byte_stream_unittest.cc |
@@ -116,7 +116,10 @@ TEST_F(ByteStreamTest, ByteStream_PushBack) { |
EXPECT_FALSE(Write(byte_stream_input.get(), 1024)); |
// Flush |
byte_stream_input->Close(0); |
+ EXPECT_EQ(4 * 1024U + 1U, byte_stream_input->GetTotalBufferedBytes()); |
message_loop_.RunUntilIdle(); |
+ // Data already sent to reader is also counted in. |
+ EXPECT_EQ(4 * 1024U + 1U, byte_stream_input->GetTotalBufferedBytes()); |
// Pull the IO buffers out; do we get the same buffers and do they |
// have the same contents? |
@@ -144,6 +147,10 @@ TEST_F(ByteStreamTest, ByteStream_PushBack) { |
EXPECT_EQ(ByteStreamReader::STREAM_COMPLETE, |
byte_stream_output->Read(&output_io_buffer, &output_length)); |
+ |
+ message_loop_.RunUntilIdle(); |
+ // Reader now knows that all data is read out. |
+ EXPECT_EQ(1024U, byte_stream_input->GetTotalBufferedBytes()); |
} |
// Confirm that Flush() method makes the writer to send written contents to |