Close connection when stream receives wrong data regarding close offset.

gfe-relnote: protected by gfe2_reloadable_flag_quic_close_connection_on_wrong_offset.
PiperOrigin-RevId: 276352453
Change-Id: Ia4174e54d01a2d8c2aa10182940c1093c1a16ad8
diff --git a/quic/core/quic_session_test.cc b/quic/core/quic_session_test.cc
index d128f0d..845277b 100644
--- a/quic/core/quic_session_test.cc
+++ b/quic/core/quic_session_test.cc
@@ -2746,11 +2746,15 @@
   session_.OnStreamFrame(frame);
 
   QuicStreamFrame frame1(stream->id(), false, 1, ",");
-  EXPECT_CALL(*connection_, SendControlFrame(_));
-  EXPECT_CALL(*connection_,
-              OnStreamReset(stream->id(), QUIC_DATA_AFTER_CLOSE_OFFSET));
+  if (!GetQuicReloadableFlag(quic_close_connection_on_wrong_offset)) {
+    EXPECT_CALL(*connection_, SendControlFrame(_));
+    EXPECT_CALL(*connection_,
+                OnStreamReset(stream->id(), QUIC_DATA_AFTER_CLOSE_OFFSET));
+  } else {
+    EXPECT_CALL(*connection_,
+                CloseConnection(QUIC_STREAM_DATA_BEYOND_CLOSE_OFFSET, _, _));
+  }
   session_.OnStreamFrame(frame1);
-  EXPECT_TRUE(connection_->connected());
 }
 
 // A client test class that can be used when the automatic configuration is not