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

Side by Side Diff: chrome/test/chromedriver/capabilities.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/chromedriver/capabilities.h" 5 #include "chrome/test/chromedriver/capabilities.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 return Status(kOk); 288 return Status(kOk);
289 } 289 }
290 290
291 Status ParseUseRemoteBrowser(const base::Value& option, 291 Status ParseUseRemoteBrowser(const base::Value& option,
292 Capabilities* capabilities) { 292 Capabilities* capabilities) {
293 std::string server_addr; 293 std::string server_addr;
294 if (!option.GetAsString(&server_addr)) 294 if (!option.GetAsString(&server_addr))
295 return Status(kUnknownError, "must be 'host:port'"); 295 return Status(kUnknownError, "must be 'host:port'");
296 296
297 std::vector<std::string> values; 297 std::vector<std::string> values = base::SplitString(
298 base::SplitString(server_addr, ':', &values); 298 server_addr, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
299 if (values.size() != 2) 299 if (values.size() != 2)
300 return Status(kUnknownError, "must be 'host:port'"); 300 return Status(kUnknownError, "must be 'host:port'");
301 301
302 int port = 0; 302 int port = 0;
303 base::StringToInt(values[1], &port); 303 base::StringToInt(values[1], &port);
304 if (port <= 0) 304 if (port <= 0)
305 return Status(kUnknownError, "port must be > 0"); 305 return Status(kUnknownError, "port must be > 0");
306 306
307 capabilities->debugger_address = NetAddress(values[0], port); 307 capabilities->debugger_address = NetAddress(values[0], port);
308 return Status(kOk); 308 return Status(kOk);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (iter == logging_prefs.end() || iter->second == Log::kOff) { 593 if (iter == logging_prefs.end() || iter->second == Log::kOff) {
594 const base::DictionaryValue* chrome_options = NULL; 594 const base::DictionaryValue* chrome_options = NULL;
595 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) && 595 if (desired_caps.GetDictionary("chromeOptions", &chrome_options) &&
596 chrome_options->HasKey("perfLoggingPrefs")) { 596 chrome_options->HasKey("perfLoggingPrefs")) {
597 return Status(kUnknownError, "perfLoggingPrefs specified, " 597 return Status(kUnknownError, "perfLoggingPrefs specified, "
598 "but performance logging was not enabled"); 598 "but performance logging was not enabled");
599 } 599 }
600 } 600 }
601 return Status(kOk); 601 return Status(kOk);
602 } 602 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_process_util_mac.cc ('k') | chrome/test/chromedriver/chrome/adb_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698