diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 23:26:14 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-01 23:26:14 +0000 |
commit | 9fad5806cd72d9f27210e62f9c8577174455df19 (patch) | |
tree | a3bab859b5ba6f19878a2e649db4379d95be950a /net | |
parent | 566fa0f2d549d5eb499aefbed9bbeb8d2a11adc2 (diff) | |
download | chromium_src-9fad5806cd72d9f27210e62f9c8577174455df19.zip chromium_src-9fad5806cd72d9f27210e62f9c8577174455df19.tar.gz chromium_src-9fad5806cd72d9f27210e62f9c8577174455df19.tar.bz2 |
Add a unit test to verify that an invalid status code (-1)
won't cause the HttpResponseHeaders constructor to crash.
R=eroman@chromium.org
BUG=none
TEST=net_unittests --gtest_filter=
HttpResponseHeadersTest.NormalizeHeadersInvalidStatusCode
Review URL: http://codereview.chromium.org/7107001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/http/http_response_headers_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc index c2d34b4..b089cac 100644 --- a/net/http/http_response_headers_unittest.cc +++ b/net/http/http_response_headers_unittest.cc @@ -188,6 +188,19 @@ TEST(HttpResponseHeadersTest, NormalizeHeadersBadStatus) { TestCommon(test); } +TEST(HttpResponseHeadersTest, NormalizeHeadersInvalidStatusCode) { + TestData test = { + "HTTP/1.1 -1 Unknown\n", + + "HTTP/1.1 200 OK\n", + + 200, + net::HttpVersion(1,1), + net::HttpVersion(1,1) + }; + TestCommon(test); +} + TEST(HttpResponseHeadersTest, NormalizeHeadersEmpty) { TestData test = { "", |