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

Side by Side Diff: base/json/json_reader_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/json/json_reader.cc ('k') | base/json/json_writer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/json_reader_unittest.cc:r69-2775
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "base/json_reader.h" 6 #include "base/json/json_reader.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 namespace base {
12
11 TEST(JSONReaderTest, Reading) { 13 TEST(JSONReaderTest, Reading) {
12 // some whitespace checking 14 // some whitespace checking
13 scoped_ptr<Value> root; 15 scoped_ptr<Value> root;
14 root.reset(JSONReader().JsonToValue(" null ", false, false)); 16 root.reset(JSONReader().JsonToValue(" null ", false, false));
15 ASSERT_TRUE(root.get()); 17 ASSERT_TRUE(root.get());
16 ASSERT_TRUE(root->IsType(Value::TYPE_NULL)); 18 ASSERT_TRUE(root->IsType(Value::TYPE_NULL));
17 19
18 // Invalid JSON string 20 // Invalid JSON string
19 root.reset(JSONReader().JsonToValue("nu", false, false)); 21 root.reset(JSONReader().JsonToValue("nu", false, false));
20 ASSERT_FALSE(root.get()); 22 ASSERT_FALSE(root.get());
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), 509 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape),
508 error_message); 510 error_message);
509 511
510 root.reset(JSONReader::ReadAndReturnError("[\"xxx\\q\"]", false, 512 root.reset(JSONReader::ReadAndReturnError("[\"xxx\\q\"]", false,
511 &error_message)); 513 &error_message));
512 EXPECT_FALSE(root.get()); 514 EXPECT_FALSE(root.get());
513 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), 515 EXPECT_EQ(JSONReader::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape),
514 error_message); 516 error_message);
515 517
516 } 518 }
519
520 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_reader.cc ('k') | base/json/json_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698