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

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

Issue 2558643002: Remove some uses of isdigit in net/, as it can be locale depedent. (Closed)
Patch Set: Response Created 4 years 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/quic_spdy_stream.cc ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_spdy_stream_test.cc
diff --git a/net/quic/core/quic_spdy_stream_test.cc b/net/quic/core/quic_spdy_stream_test.cc
index 8a1fb6062690ae395e6b877abdd8856bc328e29d..386f4b2567b0ed853e10b1952ae31dbe5c548e2a 100644
--- a/net/quic/core/quic_spdy_stream_test.cc
+++ b/net/quic/core/quic_spdy_stream_test.cc
@@ -179,11 +179,19 @@ TEST_P(QuicSpdyStreamTest, ParseHeaderStatusCode) {
Initialize(kShouldProcessData);
int status_code = 0;
- // Valid status code.
+ // Valid status codes.
headers_[":status"] = "404";
EXPECT_TRUE(stream_->ParseHeaderStatusCode(headers_, &status_code));
EXPECT_EQ(404, status_code);
+ headers_[":status"] = "100";
+ EXPECT_TRUE(stream_->ParseHeaderStatusCode(headers_, &status_code));
+ EXPECT_EQ(100, status_code);
+
+ headers_[":status"] = "599";
+ EXPECT_TRUE(stream_->ParseHeaderStatusCode(headers_, &status_code));
+ EXPECT_EQ(599, status_code);
+
// Invalid status codes.
headers_[":status"] = "010";
EXPECT_FALSE(stream_->ParseHeaderStatusCode(headers_, &status_code));
@@ -203,6 +211,12 @@ TEST_P(QuicSpdyStreamTest, ParseHeaderStatusCode) {
headers_[":status"] = "+20";
EXPECT_FALSE(stream_->ParseHeaderStatusCode(headers_, &status_code));
+ headers_[":status"] = "-10";
+ EXPECT_FALSE(stream_->ParseHeaderStatusCode(headers_, &status_code));
+
+ headers_[":status"] = "-100";
+ EXPECT_FALSE(stream_->ParseHeaderStatusCode(headers_, &status_code));
+
// Leading or trailing spaces are also invalid.
headers_[":status"] = " 200";
EXPECT_FALSE(stream_->ParseHeaderStatusCode(headers_, &status_code));
« no previous file with comments | « net/quic/core/quic_spdy_stream.cc ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698