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

Unified Diff: chrome/common/chrome_content_client_unittest.cc

Issue 2356253006: Make SplitStringUsingSubstr have consistent args. (Closed)
Patch Set: Created 4 years, 3 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
Index: chrome/common/chrome_content_client_unittest.cc
diff --git a/chrome/common/chrome_content_client_unittest.cc b/chrome/common/chrome_content_client_unittest.cc
index 269a3a1fa188953b57c8b4f5dc17cd80c0e2a00a..9a5420a4d9b9c1fa18d9d16811482c1db13f0a5f 100644
--- a/chrome/common/chrome_content_client_unittest.cc
+++ b/chrome/common/chrome_content_client_unittest.cc
@@ -26,22 +26,30 @@ void CheckUserAgentStringOrdering(bool mobile_device) {
ChromeContentClient content_client;
std::string buffer = content_client.GetUserAgent();
- base::SplitStringUsingSubstr(buffer, "Mozilla/5.0 (", &pieces);
+ pieces = base::SplitStringUsingSubstr(buffer, "Mozilla/5.0 (",
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
ASSERT_EQ(2u, pieces.size());
buffer = pieces[1];
EXPECT_EQ("", pieces[0]);
- base::SplitStringUsingSubstr(buffer, ") AppleWebKit/", &pieces);
+ pieces = base::SplitStringUsingSubstr(buffer, ") AppleWebKit/",
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
ASSERT_EQ(2u, pieces.size());
buffer = pieces[1];
std::string os_str = pieces[0];
- base::SplitStringUsingSubstr(buffer, " (KHTML, like Gecko) ", &pieces);
+ pieces = base::SplitStringUsingSubstr(buffer, " (KHTML, like Gecko) ",
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
ASSERT_EQ(2u, pieces.size());
buffer = pieces[1];
std::string webkit_version_str = pieces[0];
- base::SplitStringUsingSubstr(buffer, " Safari/", &pieces);
+ pieces = base::SplitStringUsingSubstr(buffer, " Safari/",
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
ASSERT_EQ(2u, pieces.size());
std::string product_str = pieces[0];
std::string safari_version_str = pieces[1];
« no previous file with comments | « chrome/browser/ui/webui/options/autofill_options_handler.cc ('k') | extensions/renderer/extensions_render_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698