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

Side by Side Diff: chrome/test/webdriver/commands/response.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webdriver/commands/response.h" 5 #include "chrome/test/webdriver/commands/response.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return &data_; 69 return &data_;
70 } 70 }
71 71
72 std::string Response::ToJSON() const { 72 std::string Response::ToJSON() const {
73 std::string json; 73 std::string json;
74 // The |Value| classes do not support int64 and in rare cases we need to 74 // The |Value| classes do not support int64 and in rare cases we need to
75 // return one. We do this by using a double and passing in the special 75 // return one. We do this by using a double and passing in the special
76 // option so that the JSONWriter doesn't add '.0' to the end and confuse 76 // option so that the JSONWriter doesn't add '.0' to the end and confuse
77 // the WebDriver client. 77 // the WebDriver client.
78 base::JSONWriter::WriteWithOptions( 78 base::JSONWriter::WriteWithOptions(
79 &data_, false, 79 &data_, base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION, &json);
80 base::JSONWriter::OPTIONS_OMIT_DOUBLE_TYPE_PRESERVATION, &json);
81 return json; 80 return json;
82 } 81 }
83 82
84 } // namespace webdriver 83 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/automation/javascript_message_utils.h ('k') | chrome/test/webdriver/webdriver_automation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698