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

Side by Side Diff: third_party/WebKit/Source/core/inspector/ProtocolParserTest.cpp

Issue 2490473004: [DevTools] Roll third_party/inspector_protocol to e23134c5aa6131e5a3a3afbefce255becce3a3bd. (Closed)
Patch Set: ui_devtools Created 4 years, 1 month 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
OLDNEW
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 "core/inspector/protocol/Protocol.h" 5 #include "core/inspector/protocol/Protocol.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 using protocol::parseJSON;
12 using protocol::DictionaryValue; 11 using protocol::DictionaryValue;
13 using protocol::ListValue; 12 using protocol::ListValue;
14 using protocol::Value; 13 using protocol::Value;
15 14
15 static std::unique_ptr<protocol::Value> parseJSON(const String& string) {
16 return protocol::StringUtil::parseJSON(string);
17 }
18
16 TEST(ProtocolParserTest, Reading) { 19 TEST(ProtocolParserTest, Reading) {
17 Value* tmpValue; 20 Value* tmpValue;
18 std::unique_ptr<Value> root; 21 std::unique_ptr<Value> root;
19 std::unique_ptr<Value> root2; 22 std::unique_ptr<Value> root2;
20 String strVal; 23 String strVal;
21 int intVal = 0; 24 int intVal = 0;
22 25
23 // some whitespace checking 26 // some whitespace checking
24 root = parseJSON(" null "); 27 root = parseJSON(" null ");
25 ASSERT_TRUE(root.get()); 28 ASSERT_TRUE(root.get());
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 "/* test *", "{\"foo\"", "{\"foo\":", " [", "\"\\u123g\"", "{\n\"eh:\n}", 487 "/* test *", "{\"foo\"", "{\"foo\":", " [", "\"\\u123g\"", "{\n\"eh:\n}",
485 "////", "*/**/", "/**/", "/*/", "//**/"}; 488 "////", "*/**/", "/**/", "/*/", "//**/"};
486 489
487 for (size_t i = 0; i < 11; ++i) { 490 for (size_t i = 0; i < 11; ++i) {
488 std::unique_ptr<Value> result = parseJSON(invalidJson[i]); 491 std::unique_ptr<Value> result = parseJSON(invalidJson[i]);
489 EXPECT_FALSE(result.get()); 492 EXPECT_FALSE(result.get());
490 } 493 }
491 } 494 }
492 495
493 } // namespace blink 496 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698