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

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: updated for try bot error 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 1cbe80ea392a04bedd2eda70ad818140b00f400e..ae666ba5934d692cb19fb056bddcbe7740e6ff6e 100644
--- a/net/cookies/cookie_util_unittest.cc
+++ b/net/cookies/cookie_util_unittest.cc
@@ -4,9 +4,9 @@
#include <string>
#include <utility>
-#include <vector>
#include "base/basictypes.h"
+#include "base/strings/string_split.h"
#include "net/cookies/cookie_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -16,11 +16,11 @@ namespace {
struct RequestCookieParsingTest {
std::string str;
- std::vector<std::pair<std::string, std::string> > parsed;
+ base::StringPairs parsed;
};
cookie_util::ParsedRequestCookies MakeParsedRequestCookies(
- const std::vector<std::pair<std::string, std::string>>& data) {
+ const base::StringPairs& data) {
cookie_util::ParsedRequestCookies parsed;
for (size_t i = 0; i < data.size(); i++) {
parsed.push_back(std::make_pair(base::StringPiece(data[i].first),
@@ -29,17 +29,15 @@ 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) {
cookie_util::ParsedRequestCookies parsed;
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) {
cookie_util::ParsedRequestCookies prc = MakeParsedRequestCookies(parsed);
EXPECT_EQ(str_expected, 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