Index: chrome/test/webdriver/commands/response.cc |
diff --git a/chrome/test/webdriver/commands/response.cc b/chrome/test/webdriver/commands/response.cc |
index bef138635627ee1169c4913d9a936e179e09dc04..41ea8d8190e9b8aa30ec6fb7887ee6c5e0c5c35e 100644 |
--- a/chrome/test/webdriver/commands/response.cc |
+++ b/chrome/test/webdriver/commands/response.cc |
@@ -71,7 +71,13 @@ const Value* Response::GetDictionary() const { |
std::string Response::ToJSON() const { |
std::string json; |
- base::JSONWriter::Write(&data_, false, &json); |
+ // The |Value| classes do not support int64 and in rare cases we need to |
+ // return one. We do this by using a double and passing in the special |
+ // option so that the JSONWriter doesn't add '.0' to the end and confuse |
+ // the WebDriver client. |
+ base::JSONWriter::WriteWithOptions( |
+ &data_, false, |
+ base::JSONWriter::OPTIONS_ALLOW_DOUBLES_AS_INTEGERS, &json); |
return json; |
} |