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 64fd745d5cfcd90f25df1c4860be640f6ec46f5e..24c61a18b20fafa00b246bb89442193f585ebd51 100644 |
--- a/net/quic/core/spdy_utils_test.cc |
+++ b/net/quic/core/spdy_utils_test.cc |
@@ -353,15 +353,21 @@ TEST(SpdyUtilsTest, GetHostNameFromHeaderBlock) { |
EXPECT_EQ(SpdyUtils::GetHostNameFromHeaderBlock(headers), "192.168.1.1"); |
} |
-TEST(SpdyUtilsTest, UrlIsValid) { |
+TEST(SpdyUtilsTest, PopulateHeaderBlockFromUrl) { |
+ string url = "https://www.google.com/index.html"; |
SpdyHeaderBlock headers; |
- EXPECT_FALSE(SpdyUtils::UrlIsValid(headers)); |
- headers[":scheme"] = "https"; |
- EXPECT_FALSE(SpdyUtils::UrlIsValid(headers)); |
- headers[":authority"] = "www.google.com"; |
- EXPECT_FALSE(SpdyUtils::UrlIsValid(headers)); |
- headers[":path"] = "/index.html"; |
- EXPECT_TRUE(SpdyUtils::UrlIsValid(headers)); |
+ EXPECT_TRUE(SpdyUtils::PopulateHeaderBlockFromUrl(url, &headers)); |
+ EXPECT_EQ("https", headers[":scheme"].as_string()); |
+ EXPECT_EQ("www.google.com", headers[":authority"].as_string()); |
+ EXPECT_EQ("/index.html", headers[":path"].as_string()); |
+} |
+ |
+TEST(SpdyUtilsTest, PopulateHeaderBlockFromUrlFails) { |
+ SpdyHeaderBlock headers; |
+ EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/", &headers)); |
+ EXPECT_FALSE(SpdyUtils::PopulateHeaderBlockFromUrl("/index.html", &headers)); |
+ EXPECT_FALSE( |
+ SpdyUtils::PopulateHeaderBlockFromUrl("www.google.com/", &headers)); |
} |
} // namespace test |