diff options
author | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 00:19:32 +0000 |
---|---|---|
committer | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 00:19:32 +0000 |
commit | c158a6699a9f5e5f56d913c0b06e0d83e8358591 (patch) | |
tree | 727e3eb0a5aac10658e35d2e389b057faed103bf /base | |
parent | c7eca5b2c6f9a527d18d00486d2d7cd7dca9c7b1 (diff) | |
download | chromium_src-c158a6699a9f5e5f56d913c0b06e0d83e8358591.zip chromium_src-c158a6699a9f5e5f56d913c0b06e0d83e8358591.tar.gz chromium_src-c158a6699a9f5e5f56d913c0b06e0d83e8358591.tar.bz2 |
Add support for DOM interaction in browser tests via C++.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/660046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/json/string_escape.cc | 12 | ||||
-rw-r--r-- | base/json/string_escape.h | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/base/json/string_escape.cc b/base/json/string_escape.cc index 4e1418c..5bf0b86 100644 --- a/base/json/string_escape.cc +++ b/base/json/string_escape.cc @@ -82,10 +82,22 @@ void JsonDoubleQuote(const std::string& str, JsonDoubleQuoteT(str, put_in_quotes, dst); } +std::string GetDoubleQuotedJson(const std::string& str) { + std::string dst; + JsonDoubleQuote(str, true, &dst); + return dst; +} + void JsonDoubleQuote(const string16& str, bool put_in_quotes, std::string* dst) { JsonDoubleQuoteT(str, put_in_quotes, dst); } +std::string GetDoubleQuotedJson(const string16& str) { + std::string dst; + JsonDoubleQuote(str, true, &dst); + return dst; +} + } // namespace base diff --git a/base/json/string_escape.h b/base/json/string_escape.h index 7d74021..7c64c29 100644 --- a/base/json/string_escape.h +++ b/base/json/string_escape.h @@ -13,7 +13,7 @@ namespace base { -// Escape |str| appropriately for a JSON string litereal, _appending_ the +// Escape |str| appropriately for a JSON string literal, _appending_ the // result to |dst|. This will create unicode escape sequences (\uXXXX). // If |put_in_quotes| is true, the result will be surrounded in double quotes. // The outputted literal, when interpreted by the browser, should result in a @@ -22,10 +22,15 @@ void JsonDoubleQuote(const std::string& str, bool put_in_quotes, std::string* dst); +// Same as above, but always returns the result double quoted. +std::string GetDoubleQuotedJson(const std::string& str); + void JsonDoubleQuote(const string16& str, bool put_in_quotes, std::string* dst); +// Same as above, but always returns the result double quoted. +std::string GetDoubleQuotedJson(const string16& str); } // namespace base |