Remove tests that are testing on sending only STOP_SENDING.
Theses tests use QuicStream::SendStopSending() which is never used in production.
Sending and receiving STOP_SENDING is well covered in unit tests. end to end STOP_SENDING communication is covered in end_to_end test such as EndToEndTest.SimpleStopSendingRstStreamTest
PiperOrigin-RevId: 328835344
Change-Id: I7a9f07e3582cb9412bf7a86239a4188d335d9504
diff --git a/quic/tools/quic_backend_response.h b/quic/tools/quic_backend_response.h
index 6537987..af6cf84 100644
--- a/quic/tools/quic_backend_response.h
+++ b/quic/tools/quic_backend_response.h
@@ -40,9 +40,6 @@
INCOMPLETE_RESPONSE, // The server will act as if there is a non-empty
// trailer but it will not be sent, as a result, FIN
// will not be sent too.
- STOP_SENDING, // Acts like INCOMPLETE_RESPONSE in that the entire
- // response is not sent. After sending what is sent,
- // the server will send a STOP_SENDING.
GENERATE_BYTES // Sends a response with a length equal to the number
// of bytes in the URL path.
};
@@ -73,15 +70,12 @@
void set_body(quiche::QuicheStringPiece body) {
body_.assign(body.data(), body.size());
}
- uint16_t stop_sending_code() const { return stop_sending_code_; }
- void set_stop_sending_code(uint16_t code) { stop_sending_code_ = code; }
private:
SpecialResponseType response_type_;
spdy::SpdyHeaderBlock headers_;
spdy::SpdyHeaderBlock trailers_;
std::string body_;
- uint16_t stop_sending_code_;
};
} // namespace quic
diff --git a/quic/tools/quic_memory_cache_backend.cc b/quic/tools/quic_memory_cache_backend.cc
index c7ac912..370eb4a 100644
--- a/quic/tools/quic_memory_cache_backend.cc
+++ b/quic/tools/quic_memory_cache_backend.cc
@@ -199,8 +199,8 @@
SpdyHeaderBlock response_headers,
quiche::QuicheStringPiece response_body) {
AddResponseImpl(host, path, QuicBackendResponse::REGULAR_RESPONSE,
- std::move(response_headers), response_body, SpdyHeaderBlock(),
- 0);
+ std::move(response_headers), response_body,
+ SpdyHeaderBlock());
}
void QuicMemoryCacheBackend::AddResponse(
@@ -211,7 +211,7 @@
SpdyHeaderBlock response_trailers) {
AddResponseImpl(host, path, QuicBackendResponse::REGULAR_RESPONSE,
std::move(response_headers), response_body,
- std::move(response_trailers), 0);
+ std::move(response_trailers));
}
void QuicMemoryCacheBackend::AddSpecialResponse(
@@ -219,7 +219,7 @@
quiche::QuicheStringPiece path,
SpecialResponseType response_type) {
AddResponseImpl(host, path, response_type, SpdyHeaderBlock(), "",
- SpdyHeaderBlock(), 0);
+ SpdyHeaderBlock());
}
void QuicMemoryCacheBackend::AddSpecialResponse(
@@ -229,18 +229,7 @@
quiche::QuicheStringPiece response_body,
SpecialResponseType response_type) {
AddResponseImpl(host, path, response_type, std::move(response_headers),
- response_body, SpdyHeaderBlock(), 0);
-}
-
-void QuicMemoryCacheBackend::AddStopSendingResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- uint16_t stop_sending_code) {
- AddResponseImpl(host, path, SpecialResponseType::STOP_SENDING,
- std::move(response_headers), response_body, SpdyHeaderBlock(),
- stop_sending_code);
+ response_body, SpdyHeaderBlock());
}
QuicMemoryCacheBackend::QuicMemoryCacheBackend() : cache_initialized_(false) {}
@@ -369,8 +358,7 @@
SpecialResponseType response_type,
SpdyHeaderBlock response_headers,
quiche::QuicheStringPiece response_body,
- SpdyHeaderBlock response_trailers,
- uint16_t stop_sending_code) {
+ SpdyHeaderBlock response_trailers) {
QuicWriterMutexLock lock(&response_mutex_);
DCHECK(!host.empty()) << "Host must be populated, e.g. \"www.google.com\"";
@@ -384,7 +372,6 @@
new_response->set_headers(std::move(response_headers));
new_response->set_body(response_body);
new_response->set_trailers(std::move(response_trailers));
- new_response->set_stop_sending_code(stop_sending_code);
QUIC_DVLOG(1) << "Add response with key " << key;
responses_[key] = std::move(new_response);
}
diff --git a/quic/tools/quic_memory_cache_backend.h b/quic/tools/quic_memory_cache_backend.h
index 56a2323..1c56ce6 100644
--- a/quic/tools/quic_memory_cache_backend.h
+++ b/quic/tools/quic_memory_cache_backend.h
@@ -124,12 +124,6 @@
quiche::QuicheStringPiece response_body,
QuicBackendResponse::SpecialResponseType response_type);
- void AddStopSendingResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- uint16_t stop_sending_code);
-
// Sets a default response in case of cache misses. Takes ownership of
// 'response'.
void AddDefaultResponse(QuicBackendResponse* response);
@@ -159,8 +153,7 @@
QuicBackendResponse::SpecialResponseType response_type,
spdy::SpdyHeaderBlock response_headers,
quiche::QuicheStringPiece response_body,
- spdy::SpdyHeaderBlock response_trailers,
- uint16_t stop_sending_code);
+ spdy::SpdyHeaderBlock response_trailers);
std::string GetKey(quiche::QuicheStringPiece host,
quiche::QuicheStringPiece path) const;
diff --git a/quic/tools/quic_simple_server_stream.cc b/quic/tools/quic_simple_server_stream.cc
index a6775cc..84ddb05 100644
--- a/quic/tools/quic_simple_server_stream.cc
+++ b/quic/tools/quic_simple_server_stream.cc
@@ -254,15 +254,6 @@
return;
}
- if (response->response_type() == QuicBackendResponse::STOP_SENDING) {
- QUIC_DVLOG(1)
- << "Stream " << id()
- << " sending an incomplete response, i.e. no trailer, no fin.";
- SendIncompleteResponse(response->headers().Clone(), response->body());
- SendStopSending(response->stop_sending_code());
- return;
- }
-
if (response->response_type() == QuicBackendResponse::GENERATE_BYTES) {
QUIC_DVLOG(1) << "Stream " << id() << " sending a generate bytes response.";
std::string path = request_headers_[":path"].as_string().substr(1);