Use WriteMemSlices() instead of WriteOrBufferData() in QuicTransportStream.

Originally, this was supposed to fix the fact that WriteOrBufferData() has unlimited buffering.  However, as I wrote a test for that, I discovered that I've already added a check for this by accident when I originally wrote this code.  I'm still switching this code to use WriteMemSlices() as it actually returns whether it has succeeded.

gfe-relnote: n/a (not used in production)
PiperOrigin-RevId: 288496889
Change-Id: I801c2f870dd04b9fa478e12452834ec38e20a870
diff --git a/quic/quic_transport/quic_transport_stream_test.cc b/quic/quic_transport/quic_transport_stream_test.cc
index eda6af6..f4311ce 100644
--- a/quic/quic_transport/quic_transport_stream_test.cc
+++ b/quic/quic_transport/quic_transport_stream_test.cc
@@ -120,6 +120,22 @@
   ASSERT_EQ(stream_->Read(&buffer), 4u);
 }
 
+TEST_F(QuicTransportStreamTest, WritingTooMuchData) {
+  EXPECT_CALL(interface_, IsSessionReady()).WillRepeatedly(Return(true));
+  ASSERT_TRUE(stream_->CanWrite());
+
+  std::string a_little_bit_of_data(128, 'A');
+  std::string a_lot_of_data(GetQuicFlag(FLAGS_quic_buffered_data_threshold) * 2,
+                            'a');
+
+  EXPECT_TRUE(stream_->Write(a_little_bit_of_data));
+  EXPECT_TRUE(stream_->Write(a_little_bit_of_data));
+  EXPECT_TRUE(stream_->Write(a_little_bit_of_data));
+
+  EXPECT_TRUE(stream_->Write(a_lot_of_data));
+  EXPECT_FALSE(stream_->Write(a_lot_of_data));
+}
+
 }  // namespace
 }  // namespace test
 }  // namespace quic