summaryrefslogtreecommitdiffstats
path: root/chrome/common/json_value_serializer_unittest.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 21:33:49 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-26 21:33:49 +0000
commit2c54edff1f9592d3f4554c4608d823122480f049 (patch)
tree75cc98dd631249bdc07618cda4abd2a514156199 /chrome/common/json_value_serializer_unittest.cc
parentff8389293372e9b7b2db0799f5f9a512af694cf8 (diff)
downloadchromium_src-2c54edff1f9592d3f4554c4608d823122480f049.zip
chromium_src-2c54edff1f9592d3f4554c4608d823122480f049.tar.gz
chromium_src-2c54edff1f9592d3f4554c4608d823122480f049.tar.bz2
Missed a test that needed to be updated with r19418.
BUG=15462 TEST=unit_tests --gtest_filter=JSONValueSerializerTest.Roundtrip Review URL: http://codereview.chromium.org/149103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/json_value_serializer_unittest.cc')
-rw-r--r--chrome/common/json_value_serializer_unittest.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/chrome/common/json_value_serializer_unittest.cc b/chrome/common/json_value_serializer_unittest.cc
index 877ac6e..e622458 100644
--- a/chrome/common/json_value_serializer_unittest.cc
+++ b/chrome/common/json_value_serializer_unittest.cc
@@ -51,14 +51,22 @@ TEST(JSONValueSerializerTest, Roundtrip) {
mutable_serializer.set_pretty_print(true);
ASSERT_TRUE(mutable_serializer.Serialize(*root_dict));
+ // JSON output uses a different newline style on Windows than on other
+ // platforms.
+#if defined(OS_WIN)
+#define JSON_NEWLINE "\r\n"
+#else
+#define JSON_NEWLINE "\n"
+#endif
const std::string pretty_serialization =
- "{\r\n"
- " \"bool\": true,\r\n"
- " \"int\": 42,\r\n"
- " \"list\": [ 1, 2 ],\r\n"
- " \"null\": null,\r\n"
- " \"real\": 3.14\r\n"
- "}\r\n";
+ "{" JSON_NEWLINE
+ " \"bool\": true," JSON_NEWLINE
+ " \"int\": 42," JSON_NEWLINE
+ " \"list\": [ 1, 2 ]," JSON_NEWLINE
+ " \"null\": null," JSON_NEWLINE
+ " \"real\": 3.14" JSON_NEWLINE
+ "}" JSON_NEWLINE;
+#undef JSON_NEWLINE
ASSERT_EQ(pretty_serialization, test_serialization);
}