| Index: net/quic/core/spdy_utils_test.cc
|
| diff --git a/net/quic/core/spdy_utils_test.cc b/net/quic/core/spdy_utils_test.cc
|
| index 1b19488f4cd84671fedd77cd0d526cbe83276dbc..034af2537280bb3221abd66d7d8d5e07a807502f 100644
|
| --- a/net/quic/core/spdy_utils_test.cc
|
| +++ b/net/quic/core/spdy_utils_test.cc
|
| @@ -7,7 +7,6 @@
|
|
|
| #include "base/macros.h"
|
| #include "net/quic/platform/api/quic_string_piece.h"
|
| -#include "net/quic/platform/api/quic_test.h"
|
| #include "net/quic/platform/api/quic_text_utils.h"
|
| #include "net/test/gtest_util.h"
|
|
|
| @@ -29,9 +28,7 @@ static std::unique_ptr<QuicHeaderList> FromList(
|
| return headers;
|
| }
|
|
|
| -class SpdyUtilsTest : public QuicTest {};
|
| -
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeaders) {
|
| +TEST(CopyAndValidateHeaders, NormalUsage) {
|
| auto headers = FromList({// All cookie crumbs are joined.
|
| {"cookie", " part 1"},
|
| {"cookie", "part 2 "},
|
| @@ -70,7 +67,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeaders) {
|
| EXPECT_EQ(-1, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersEmptyName) {
|
| +TEST(CopyAndValidateHeaders, EmptyName) {
|
| auto headers = FromList({{"foo", "foovalue"}, {"", "barvalue"}, {"baz", ""}});
|
| int64_t content_length = -1;
|
| SpdyHeaderBlock block;
|
| @@ -78,7 +75,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersEmptyName) {
|
| SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersUpperCaseName) {
|
| +TEST(CopyAndValidateHeaders, UpperCaseName) {
|
| auto headers =
|
| FromList({{"foo", "foovalue"}, {"bar", "barvalue"}, {"bAz", ""}});
|
| int64_t content_length = -1;
|
| @@ -87,7 +84,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersUpperCaseName) {
|
| SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleContentLengths) {
|
| +TEST(CopyAndValidateHeaders, MultipleContentLengths) {
|
| auto headers = FromList({{"content-length", "9"},
|
| {"foo", "foovalue"},
|
| {"content-length", "9"},
|
| @@ -107,7 +104,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleContentLengths) {
|
| EXPECT_EQ(9, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersInconsistentContentLengths) {
|
| +TEST(CopyAndValidateHeaders, InconsistentContentLengths) {
|
| auto headers = FromList({{"content-length", "9"},
|
| {"foo", "foovalue"},
|
| {"content-length", "8"},
|
| @@ -119,7 +116,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersInconsistentContentLengths) {
|
| SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersLargeContentLength) {
|
| +TEST(CopyAndValidateHeaders, LargeContentLength) {
|
| auto headers = FromList({{"content-length", "9000000000"},
|
| {"foo", "foovalue"},
|
| {"bar", "barvalue"},
|
| @@ -135,7 +132,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersLargeContentLength) {
|
| EXPECT_EQ(9000000000, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleValues) {
|
| +TEST(CopyAndValidateHeaders, MultipleValues) {
|
| auto headers = FromList({{"foo", "foovalue"},
|
| {"bar", "barvalue"},
|
| {"baz", ""},
|
| @@ -152,7 +149,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleValues) {
|
| EXPECT_EQ(-1, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMoreThanTwoValues) {
|
| +TEST(CopyAndValidateHeaders, MoreThanTwoValues) {
|
| auto headers = FromList({{"set-cookie", "value1"},
|
| {"set-cookie", "value2"},
|
| {"set-cookie", "value3"}});
|
| @@ -166,7 +163,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMoreThanTwoValues) {
|
| EXPECT_EQ(-1, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersCookie) {
|
| +TEST(CopyAndValidateHeaders, Cookie) {
|
| auto headers = FromList({{"foo", "foovalue"},
|
| {"bar", "barvalue"},
|
| {"cookie", "value1"},
|
| @@ -181,7 +178,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersCookie) {
|
| EXPECT_EQ(-1, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleCookies) {
|
| +TEST(CopyAndValidateHeaders, MultipleCookies) {
|
| auto headers = FromList({{"foo", "foovalue"},
|
| {"bar", "barvalue"},
|
| {"cookie", "value1"},
|
| @@ -197,7 +194,7 @@ TEST_F(SpdyUtilsTest, CopyAndValidateHeadersMultipleCookies) {
|
| EXPECT_EQ(-1, content_length);
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, GetUrlFromHeaderBlock) {
|
| +TEST(GetUrlFromHeaderBlock, Basic) {
|
| SpdyHeaderBlock headers;
|
| EXPECT_EQ(SpdyUtils::GetUrlFromHeaderBlock(headers), "");
|
| headers[":scheme"] = "https";
|
| @@ -213,7 +210,7 @@ TEST_F(SpdyUtilsTest, GetUrlFromHeaderBlock) {
|
| "https://www.google.com/index.html");
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, GetHostNameFromHeaderBlock) {
|
| +TEST(GetHostNameFromHeaderBlock, NormalUsage) {
|
| SpdyHeaderBlock headers;
|
| EXPECT_EQ(SpdyUtils::GetHostNameFromHeaderBlock(headers), "");
|
| headers[":scheme"] = "https";
|
| @@ -233,7 +230,7 @@ TEST_F(SpdyUtilsTest, GetHostNameFromHeaderBlock) {
|
| EXPECT_EQ(SpdyUtils::GetHostNameFromHeaderBlock(headers), "192.168.1.1");
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrl) {
|
| +TEST(PopulateHeaderBlockFromUrl, NormalUsage) {
|
| string url = "https://www.google.com/index.html";
|
| SpdyHeaderBlock headers;
|
| EXPECT_TRUE(SpdyUtils::PopulateHeaderBlockFromUrl(url, &headers));
|
| @@ -242,7 +239,7 @@ TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrl) {
|
| EXPECT_EQ("/index.html", headers[":path"].as_string());
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrlWithNoPath) {
|
| +TEST(PopulateHeaderBlockFromUrl, UrlWithNoPath) {
|
| string url = "https://www.google.com";
|
| SpdyHeaderBlock headers;
|
| EXPECT_TRUE(SpdyUtils::PopulateHeaderBlockFromUrl(url, &headers));
|
| @@ -251,7 +248,7 @@ TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrlWithNoPath) {
|
| EXPECT_EQ("/", headers[":path"].as_string());
|
| }
|
|
|
| -TEST_F(SpdyUtilsTest, PopulateHeaderBlockFromUrlFails) {
|
| +TEST(PopulateHeaderBlockFromUrl, Failure) {
|
| SpdyHeaderBlock headers;
|
| EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/", &headers));
|
| EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/index.html", &headers));
|
|
|