OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/scoped_temp_dir.h" | |
10 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_temp_dir.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "content/common/json_value_serializer.h" | 16 #include "content/common/json_value_serializer.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 TEST(JSONValueSerializerTest, Roundtrip) { | 19 TEST(JSONValueSerializerTest, Roundtrip) { |
20 const std::string original_serialization = | 20 const std::string original_serialization = |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 FilePath source_file_path; | 329 FilePath source_file_path; |
330 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &source_file_path)); | 330 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &source_file_path)); |
331 source_file_path = source_file_path.Append( | 331 source_file_path = source_file_path.Append( |
332 FILE_PATH_LITERAL("serializer_test_nowhitespace.js")); | 332 FILE_PATH_LITERAL("serializer_test_nowhitespace.js")); |
333 ASSERT_TRUE(file_util::PathExists(source_file_path)); | 333 ASSERT_TRUE(file_util::PathExists(source_file_path)); |
334 JSONFileValueSerializer serializer(source_file_path); | 334 JSONFileValueSerializer serializer(source_file_path); |
335 scoped_ptr<Value> root; | 335 scoped_ptr<Value> root; |
336 root.reset(serializer.Deserialize(NULL, NULL)); | 336 root.reset(serializer.Deserialize(NULL, NULL)); |
337 ASSERT_TRUE(root.get()); | 337 ASSERT_TRUE(root.get()); |
338 } | 338 } |
OLD | NEW |