| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 "platform/json/JSONParser.h" | 5 #include "platform/json/JSONParser.h" |
| 6 | 6 |
| 7 #include "platform/json/JSONValues.h" | 7 #include "platform/json/JSONValues.h" |
| 8 #include "platform/wtf/text/StringBuilder.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "wtf/text/StringBuilder.h" | |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 TEST(JSONParserTest, Reading) { | 13 TEST(JSONParserTest, Reading) { |
| 14 JSONValue* tmpValue; | 14 JSONValue* tmpValue; |
| 15 std::unique_ptr<JSONValue> root; | 15 std::unique_ptr<JSONValue> root; |
| 16 std::unique_ptr<JSONValue> root2; | 16 std::unique_ptr<JSONValue> root2; |
| 17 String strVal; | 17 String strVal; |
| 18 int intVal = 0; | 18 int intVal = 0; |
| 19 | 19 |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 evil.append('['); | 541 evil.append('['); |
| 542 for (int i = 0; i < 1001; ++i) | 542 for (int i = 0; i < 1001; ++i) |
| 543 evil.append(']'); | 543 evil.append(']'); |
| 544 root = parseJSON(evil.toString()); | 544 root = parseJSON(evil.toString()); |
| 545 EXPECT_FALSE(root.get()); | 545 EXPECT_FALSE(root.get()); |
| 546 root = parseJSON(evil.toString(), 1001); | 546 root = parseJSON(evil.toString(), 1001); |
| 547 EXPECT_FALSE(root.get()); | 547 EXPECT_FALSE(root.get()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace blink | 550 } // namespace blink |
| OLD | NEW |