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

Unified Diff: net/cookies/cookie_util_unittest.cc

Issue 1092923006: Use of base::StringPairs appropriately in cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Included the required header file. Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_util_unittest.cc
diff --git a/net/cookies/cookie_util_unittest.cc b/net/cookies/cookie_util_unittest.cc
index 392faf122c1caef7a8ca0aa285e55f1fa4224130..ed1b94f5bb1faee70ecc52e4808d6089b157dc30 100644
--- a/net/cookies/cookie_util_unittest.cc
+++ b/net/cookies/cookie_util_unittest.cc
@@ -7,6 +7,7 @@
#include <vector>
eroman 2015/04/23 20:14:39 can this be removed now?
#include "base/basictypes.h"
+#include "base/strings/string_split.h"
#include "net/cookies/cookie_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -14,11 +15,11 @@ namespace {
struct RequestCookieParsingTest {
std::string str;
- std::vector<std::pair<std::string, std::string> > parsed;
+ base::StringPairs parsed;
};
net::cookie_util::ParsedRequestCookies MakeParsedRequestCookies(
- const std::vector<std::pair<std::string, std::string> >& data) {
+ const base::StringPairs& data) {
net::cookie_util::ParsedRequestCookies parsed;
for (size_t i = 0; i < data.size(); i++) {
parsed.push_back(std::make_pair(base::StringPiece(data[i].first),
@@ -27,17 +28,15 @@ net::cookie_util::ParsedRequestCookies MakeParsedRequestCookies(
return parsed;
}
-void CheckParse(
- const std::string& str,
- const std::vector<std::pair<std::string, std::string> >& parsed_expected) {
+void CheckParse(const std::string& str,
+ const base::StringPairs& parsed_expected) {
net::cookie_util::ParsedRequestCookies parsed;
net::cookie_util::ParseRequestCookieLine(str, &parsed);
EXPECT_EQ(MakeParsedRequestCookies(parsed_expected), parsed);
}
-void CheckSerialize(
- const std::vector<std::pair<std::string, std::string> >& parsed,
- const std::string& str_expected) {
+void CheckSerialize(const base::StringPairs& parsed,
+ const std::string& str_expected) {
net::cookie_util::ParsedRequestCookies prc =
MakeParsedRequestCookies(parsed);
EXPECT_EQ(str_expected, net::cookie_util::SerializeRequestCookieLine(prc));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698