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

Unified Diff: net/quic/core/spdy_utils_test.cc

Issue 2363393004: Remove usage of BalsaHeaders from QuicClient. Also move QuicDataToResend from QuicClient to QuicCli… (Closed)
Patch Set: Fix win Created 4 years, 3 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/core/spdy_utils.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/quic/core/spdy_utils.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698