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

Unified Diff: net/http/http_util_unittest.cc

Issue 2549143003: Cleaned up the API of HttpUtil::ParseContentRangeHeader(). (Closed)
Patch Set: Fixed unittest 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/http/http_util.cc ('k') | net/http/partial_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util_unittest.cc
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index ee38dc6a465019d14df5be0753b3e4c0e0fd7ea0..1c41d82ae749a4c7a9e4f8334f34a7b594ed2439 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -995,40 +995,37 @@ TEST(HttpUtilTest, ParseContentRangeHeader) {
{" bytes 0 - 50 \t / \t51", true, 0, 50, 51},
{"bytes 0\t-\t50\t/\t51\t", true, 0, 50, 51},
{" \tbytes\t\t\t 0\t-\t50\t/\t51\t", true, 0, 50, 51},
- {"\t bytes \t 0 - 50 / 5 1", false, 0, 50, -1},
+ {"\t bytes \t 0 - 50 / 5 1", false, -1, -1, -1},
{"\t bytes \t 0 - 5 0 / 51", false, -1, -1, -1},
- {"bytes 50-0/51", false, 50, 0, -1},
+ {"bytes 50-0/51", false, -1, -1, -1},
{"bytes * /*", false, -1, -1, -1},
{"bytes * / * ", false, -1, -1, -1},
- {"bytes 0-50/*", false, 0, 50, -1},
- {"bytes 0-50 / * ", false, 0, 50, -1},
+ {"bytes 0-50/*", false, -1, -1, -1},
+ {"bytes 0-50 / * ", false, -1, -1, -1},
{"bytes 0-10000000000/10000000001", true, 0, 10000000000ll,
10000000001ll},
- {"bytes 0-10000000000/10000000000", false, 0, 10000000000ll,
- 10000000000ll},
+ {"bytes 0-10000000000/10000000000", false, -1, -1, -1},
// 64 bit wraparound.
- {"bytes 0 - 9223372036854775807 / 100", false, 0,
- std::numeric_limits<int64_t>::max(), 100},
+ {"bytes 0 - 9223372036854775807 / 100", false, -1, -1, -1},
// 64 bit wraparound.
- {"bytes 0 - 100 / -9223372036854775808", false, 0, 100,
- std::numeric_limits<int64_t>::min()},
- {"bytes */50", false, -1, -1, 50},
- {"bytes 0-50/10", false, 0, 50, 10},
- {"bytes 40-50/45", false, 40, 50, 45},
- {"bytes 0-50/-10", false, 0, 50, -10},
+ {"bytes 0 - 100 / -9223372036854775808", false, -1, -1, -1},
+ {"bytes */50", false, -1, -1, -1},
+ {"bytes 0-50/10", false, -1, -1, -1},
+ {"bytes 40-50/45", false, -1, -1, -1},
+ {"bytes 0-50/-10", false, -1, -1, -1},
{"bytes 0-0/1", true, 0, 0, 1},
{"bytes 0-40000000000000000000/40000000000000000001", false, -1, -1, -1},
{"bytes 1-/100", false, -1, -1, -1},
{"bytes -/100", false, -1, -1, -1},
{"bytes -1/100", false, -1, -1, -1},
- {"bytes 0-1233/*", false, 0, 1233, -1},
+ {"bytes 0-1233/*", false, -1, -1, -1},
{"bytes -123 - -1/100", false, -1, -1, -1},
};
for (const auto& test : tests) {
int64_t first_byte_position, last_byte_position, instance_length;
EXPECT_EQ(test.expected_return_value,
- HttpUtil::ParseContentRangeHeader(
+ HttpUtil::ParseContentRangeHeaderFor206(
test.content_range_header_spec, &first_byte_position,
&last_byte_position, &instance_length))
<< test.content_range_header_spec;
« no previous file with comments | « net/http/http_util.cc ('k') | net/http/partial_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698