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

Unified Diff: net/http/http_util_unittest.cc

Issue 78343004: Net: Standardize HttpByteRange printing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: net/http/http_util_unittest.cc
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index fe2d8b47496ea29b529596d65dd3e22e9e54e8e7..6683717ba05750cdefbe22335d604a0a247a16fe 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <algorithm>
+#include <vector>
#include "base/basictypes.h"
#include "base/strings/string_util.h"
@@ -850,6 +851,18 @@ TEST(HttpUtilTest, ParseRanges) {
}
}
+TEST(HttpUtilTest, PrintRanges) {
+ std::vector<net::HttpByteRange> ranges;
+ ranges.push_back(net::HttpByteRange::Bounded(0, 100));
+ ranges.push_back(net::HttpByteRange::RightUnbounded(200));
+ EXPECT_EQ("bytes=0-100,200-", net::HttpUtil::PrintRanges(ranges));
+
+ ranges.clear();
+ ranges.push_back(net::HttpByteRange::Bounded(0, 100));
+ ranges.push_back(net::HttpByteRange::Suffix(1000));
+ EXPECT_EQ("bytes=0-100,-1000", net::HttpUtil::PrintRanges(ranges));
+}
+
namespace {
void CheckCurrentNameValuePair(HttpUtil::NameValuePairsIterator* parser,
bool expect_valid,
« net/http/http_util.h ('K') | « 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