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

Unified Diff: net/spdy/spdy_alt_svc_wire_format_test.cc

Issue 1420783002: Add quotation marks around probability value in Alternative Services. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 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/spdy/spdy_alt_svc_wire_format.cc ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_alt_svc_wire_format_test.cc
diff --git a/net/spdy/spdy_alt_svc_wire_format_test.cc b/net/spdy/spdy_alt_svc_wire_format_test.cc
index f4cb0cbc262cbfdd0d785684f6cc9ab8cd975f93..4d9de3598087cc90f39d681e0dd4d93b7282d517 100644
--- a/net/spdy/spdy_alt_svc_wire_format_test.cc
+++ b/net/spdy/spdy_alt_svc_wire_format_test.cc
@@ -90,11 +90,11 @@ void FuzzHeaderFieldValue(
expected_altsvc->p = 1.0;
if (i & 1 << 5) {
expected_altsvc->p = 0.33;
- header_field_value->append("; P=.33");
+ header_field_value->append("; P=\".33\"");
}
if (i & 1 << 6) {
expected_altsvc->p = 0.0;
- header_field_value->append("; p=0");
+ header_field_value->append("; p=\"0\"");
}
if (i & 1 << 7) {
expected_altsvc->max_age = 999999999;
@@ -102,7 +102,7 @@ void FuzzHeaderFieldValue(
}
if (i & 1 << 8) {
expected_altsvc->p = 0.0;
- header_field_value->append("; P=0.");
+ header_field_value->append("; P=\"0.\"");
}
if (i & 1 << 9) {
header_field_value->append(";");
@@ -140,7 +140,7 @@ void FuzzAlternativeService(int i,
altsvc->p = 1.0;
if (i & 1 << 2) {
altsvc->p = 0.33;
- expected_header_field_value->append("; p=0.33");
+ expected_header_field_value->append("; p=\"0.33\"");
}
}
@@ -247,8 +247,9 @@ TEST(SpdyAltSvcWireFormatTest, ParseHeaderFieldValueInvalid) {
"a=", "a=\"", "a=\"b\"", "a=\":\"", "a=\"c:\"", "a=\"c:foo\"",
"a=\"c:42foo\"", "a=\"b:42\"bar", "a=\"b:42\" ; m",
"a=\"b:42\" ; min-age", "a=\"b:42\" ; ma", "a=\"b:42\" ; ma=",
- "a=\"b:42\" ; ma=ma", "a=\"b:42\" ; ma=123bar", "a=\"b:42\" ; p=-2",
- "a=\"b:42\" ; p=..", "a=\"b:42\" ; p=1.05"};
+ "a=\"b:42\" ; ma=ma", "a=\"b:42\" ; ma=123bar", "a=\"b:42\" ; p=\"-2\"",
+ "a=\"b:42\" ; p=\"..\"", "a=\"b:42\" ; p=\"1.05\"", "a=\"b:42\" ; p=0.4",
+ "a=\"b:42\" ; p=\" 1.0\""};
for (const char* invalid_field_value : invalid_field_value_array) {
EXPECT_FALSE(SpdyAltSvcWireFormat::ParseHeaderFieldValue(
invalid_field_value, &altsvc_vector))
« no previous file with comments | « net/spdy/spdy_alt_svc_wire_format.cc ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698