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

Unified Diff: base/json/string_escape_unittest.cc

Issue 316016: Move the json-related files into a separate json directory. This hopefully al... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/json/string_escape.cc ('k') | base/json_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/string_escape_unittest.cc
===================================================================
--- base/json/string_escape_unittest.cc (revision 0)
+++ base/json/string_escape_unittest.cc (working copy)
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/json/string_escape.h"
+#include "base/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "base/string_escape.h"
-#include "base/string_util.h"
+namespace base {
+
namespace {
const struct json_narrow_test_data {
@@ -24,17 +26,17 @@
for (size_t i = 0; i < arraysize(json_narrow_cases); ++i) {
std::string in = json_narrow_cases[i].to_escape;
std::string out;
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
EXPECT_EQ(std::string(json_narrow_cases[i].escaped), out);
}
std::string in = json_narrow_cases[0].to_escape;
std::string out;
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
// test quoting
std::string out_quoted;
- string_escape::JsonDoubleQuote(in, true, &out_quoted);
+ JsonDoubleQuote(in, true, &out_quoted);
EXPECT_EQ(out.length() + 2, out_quoted.length());
EXPECT_EQ(out_quoted.find(out), 1U);
@@ -45,7 +47,7 @@
std::string expected = "test\\u0000";
expected += json_narrow_cases[0].escaped;
out.clear();
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
EXPECT_EQ(expected, out);
}
@@ -69,17 +71,17 @@
for (size_t i = 0; i < arraysize(json_wide_cases); ++i) {
std::string out;
string16 in = WideToUTF16(json_wide_cases[i].to_escape);
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
EXPECT_EQ(std::string(json_wide_cases[i].escaped), out);
}
string16 in = WideToUTF16(json_wide_cases[0].to_escape);
std::string out;
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
// test quoting
std::string out_quoted;
- string_escape::JsonDoubleQuote(in, true, &out_quoted);
+ JsonDoubleQuote(in, true, &out_quoted);
EXPECT_EQ(out.length() + 2, out_quoted.length());
EXPECT_EQ(out_quoted.find(out), 1U);
@@ -90,6 +92,8 @@
std::string expected = "test\\u0000";
expected += json_wide_cases[0].escaped;
out.clear();
- string_escape::JsonDoubleQuote(in, false, &out);
+ JsonDoubleQuote(in, false, &out);
EXPECT_EQ(expected, out);
}
+
+} // namespace base
Property changes on: base/json/string_escape_unittest.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/string_escape_unittest.cc:r69-2775
« no previous file with comments | « base/json/string_escape.cc ('k') | base/json_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698