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

Side by Side Diff: chrome/test/chromedriver/capabilities.cc

Issue 106793004: Revert of Stop doing unnecessary UTF-8 to UTF-16 conversions in JSONWriter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 386 }
387 387
388 std::string Switches::ToString() const { 388 std::string Switches::ToString() const {
389 std::string str; 389 std::string str;
390 SwitchMap::const_iterator iter = switch_map_.begin(); 390 SwitchMap::const_iterator iter = switch_map_.begin();
391 while (iter != switch_map_.end()) { 391 while (iter != switch_map_.end()) {
392 str += "--" + iter->first; 392 str += "--" + iter->first;
393 std::string value = GetSwitchValue(iter->first); 393 std::string value = GetSwitchValue(iter->first);
394 if (value.length()) { 394 if (value.length()) {
395 if (value.find(' ') != std::string::npos) 395 if (value.find(' ') != std::string::npos)
396 value = base::GetQuotedJSONString(value); 396 value = base::GetDoubleQuotedJson(value);
397 str += "=" + value; 397 str += "=" + value;
398 } 398 }
399 ++iter; 399 ++iter;
400 if (iter == switch_map_.end()) 400 if (iter == switch_map_.end())
401 break; 401 break;
402 str += " "; 402 str += " ";
403 } 403 }
404 return str; 404 return str;
405 } 405 }
406 406
(...skipping 22 matching lines...) Expand all
429 if (desired_caps.Get(it->first, &capability)) { 429 if (desired_caps.Get(it->first, &capability)) {
430 Status status = it->second.Run(*capability, this); 430 Status status = it->second.Run(*capability, this);
431 if (status.IsError()) { 431 if (status.IsError()) {
432 return Status( 432 return Status(
433 kUnknownError, "cannot parse capability: " + it->first, status); 433 kUnknownError, "cannot parse capability: " + it->first, status);
434 } 434 }
435 } 435 }
436 } 436 }
437 return Status(kOk); 437 return Status(kOk);
438 } 438 }
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox_extension.cc ('k') | chrome/test/chromedriver/chrome/adb_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698