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

Unified Diff: chrome/test/chromedriver/element_commands.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/test/chromedriver/element_commands.cc
diff --git a/chrome/test/chromedriver/element_commands.cc b/chrome/test/chromedriver/element_commands.cc
index 49df7178e9d8185cfb34fcb88ee861f92faa6283..ebb7b97dfc3a2443878f95f6231a4ca667574ddc 100644
--- a/chrome/test/chromedriver/element_commands.cc
+++ b/chrome/test/chromedriver/element_commands.cc
@@ -334,11 +334,11 @@ Status ExecuteSendKeysToElement(
}
// Separate the string into separate paths, delimited by '\n'.
- std::vector<base::FilePath::StringType> path_strings;
- base::SplitString(paths_string, '\n', &path_strings);
std::vector<base::FilePath> paths;
- for (size_t i = 0; i < path_strings.size(); ++i)
- paths.push_back(base::FilePath(path_strings[i]));
+ for (const auto& path_piece : base::SplitStringPiece(
+ paths_string, base::FilePath::StringType(1, '\n'),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))
+ paths.push_back(base::FilePath(path_piece));
bool multiple = false;
status = IsElementAttributeEqualToIgnoreCase(
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher_unittest.cc ('k') | chrome/test/chromedriver/server/chromedriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698