Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: net/quic/quic_http_stream_test.cc

Issue 12326073: Remove the --use-spdy-over-quic command line option. Always use SPDY over QUIC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_http_stream.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream_test.cc
diff --git a/net/quic/quic_http_stream_test.cc b/net/quic/quic_http_stream_test.cc
index a16f2f97d8678b1f5473a7e8a812d818c92f2976..2b43b2ef6633d239e0f7098e22f9d493d91c38e6 100644
--- a/net/quic/quic_http_stream_test.cc
+++ b/net/quic/quic_http_stream_test.cc
@@ -83,8 +83,8 @@ class TestReceiveAlgorithm : public ReceiveAlgorithmInterface {
// is received.
class AutoClosingStream : public QuicHttpStream {
public:
- AutoClosingStream(QuicReliableClientStream* stream, bool use_spdy)
- : QuicHttpStream(stream, use_spdy) {
+ explicit AutoClosingStream(QuicReliableClientStream* stream)
+ : QuicHttpStream(stream) {
}
virtual int OnDataReceived(const char* data, int length) OVERRIDE {
@@ -183,35 +183,26 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<bool> {
QuicReliableClientStream* stream =
session_->CreateOutgoingReliableStream();
stream_.reset(use_closing_stream_ ?
- new AutoClosingStream(stream, GetParam()) :
- new QuicHttpStream(stream, GetParam()));
+ new AutoClosingStream(stream) :
+ new QuicHttpStream(stream));
}
void SetRequestString(const std::string& method, const std::string& path) {
- if (GetParam() == true) {
- SpdyHeaderBlock headers;
- headers[":method"] = method;
- headers[":host"] = "www.google.com";
- headers[":path"] = path;
- headers[":scheme"] = "http";
- headers[":version"] = "HTTP/1.1";
- request_data_ = SerializeHeaderBlock(headers);
- } else {
- request_data_ = method + " " + path + " HTTP/1.1\r\n\r\n";
- }
+ SpdyHeaderBlock headers;
+ headers[":method"] = method;
+ headers[":host"] = "www.google.com";
+ headers[":path"] = path;
+ headers[":scheme"] = "http";
+ headers[":version"] = "HTTP/1.1";
+ request_data_ = SerializeHeaderBlock(headers);
}
void SetResponseString(const std::string& status, const std::string& body) {
- if (GetParam() == true) {
- SpdyHeaderBlock headers;
- headers[":status"] = status;
- headers[":version"] = "HTTP/1.1";
- headers["content-type"] = "text/plain";
- response_data_ = SerializeHeaderBlock(headers) + body;
- } else {
- response_data_ = "HTTP/1.1 " + status + " \r\n"
- "Content-Type: text/plain\r\n\r\n" + body;
- }
+ SpdyHeaderBlock headers;
+ headers[":status"] = status;
+ headers[":version"] = "HTTP/1.1";
+ headers["content-type"] = "text/plain";
+ response_data_ = SerializeHeaderBlock(headers) + body;
}
std::string SerializeHeaderBlock(const SpdyHeaderBlock& headers) {
@@ -310,28 +301,23 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<bool> {
std::vector<PacketToWrite> writes_;
};
-// All tests are run with two different serializations, HTTP/SPDY
-INSTANTIATE_TEST_CASE_P(QuicHttpStreamTests,
- QuicHttpStreamTest,
- ::testing::Values(true, false));
-
-TEST_P(QuicHttpStreamTest, RenewStreamForAuth) {
+TEST_F(QuicHttpStreamTest, RenewStreamForAuth) {
EXPECT_EQ(NULL, stream_->RenewStreamForAuth());
}
-TEST_P(QuicHttpStreamTest, CanFindEndOfResponse) {
+TEST_F(QuicHttpStreamTest, CanFindEndOfResponse) {
EXPECT_TRUE(stream_->CanFindEndOfResponse());
}
-TEST_P(QuicHttpStreamTest, IsMoreDataBuffered) {
+TEST_F(QuicHttpStreamTest, IsMoreDataBuffered) {
EXPECT_FALSE(stream_->IsMoreDataBuffered());
}
-TEST_P(QuicHttpStreamTest, IsConnectionReusable) {
+TEST_F(QuicHttpStreamTest, IsConnectionReusable) {
EXPECT_FALSE(stream_->IsConnectionReusable());
}
-TEST_P(QuicHttpStreamTest, GetRequest) {
+TEST_F(QuicHttpStreamTest, GetRequest) {
SetRequestString("GET", "/");
AddWrite(SYNCHRONOUS, ConstructDataPacket(1, kFin, 0,
request_data_));
@@ -374,7 +360,7 @@ TEST_P(QuicHttpStreamTest, GetRequest) {
EXPECT_TRUE(AtEof());
}
-TEST_P(QuicHttpStreamTest, GetRequestFullResponseInSinglePacket) {
+TEST_F(QuicHttpStreamTest, GetRequestFullResponseInSinglePacket) {
SetRequestString("GET", "/");
AddWrite(SYNCHRONOUS, ConstructDataPacket(1, kFin, 0, request_data_));
AddWrite(SYNCHRONOUS, ConstructAckPacket(2, 2, 2));
@@ -417,7 +403,7 @@ TEST_P(QuicHttpStreamTest, GetRequestFullResponseInSinglePacket) {
EXPECT_TRUE(AtEof());
}
-TEST_P(QuicHttpStreamTest, SendPostRequest) {
+TEST_F(QuicHttpStreamTest, SendPostRequest) {
SetRequestString("POST", "/");
AddWrite(SYNCHRONOUS, ConstructDataPacket(1, !kFin, 0, request_data_));
AddWrite(SYNCHRONOUS, ConstructDataPacket(2, kFin, request_data_.length(),
@@ -472,7 +458,7 @@ TEST_P(QuicHttpStreamTest, SendPostRequest) {
EXPECT_TRUE(AtEof());
}
-TEST_P(QuicHttpStreamTest, DestroyedEarly) {
+TEST_F(QuicHttpStreamTest, DestroyedEarly) {
SetRequestString("GET", "/");
AddWrite(SYNCHRONOUS, ConstructDataPacket(1, kFin, 0, request_data_));
AddWrite(SYNCHRONOUS, ConstructRstPacket(2, 3));
« no previous file with comments | « net/quic/quic_http_stream.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698