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

Side by Side Diff: components/json_schema/json_schema_validator_unittest_base.h

Issue 195193002: Add regular expression support in json_schema component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_ 5 #ifndef COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
6 #define COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_ 6 #define COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace base { 10 namespace base {
11 class DictionaryValue; 11 class DictionaryValue;
12 class ListValue; 12 class ListValue;
13 class Value; 13 class Value;
14 } 14 }
15 15
16 // Base class for unit tests for JSONSchemaValidator. There is currently only 16 // Base class for unit tests for JSONSchemaValidator. There is currently only
17 // one implementation, JSONSchemaValidatorCPPTest. 17 // one implementation, JSONSchemaValidatorCPPTest.
18 // 18 //
19 // TODO(aa): Refactor chrome/test/data/json_schema_test.js into 19 // TODO(aa): Refactor chrome/test/data/json_schema_test.js into
20 // JSONSchemaValidatorJSTest that inherits from this. 20 // JSONSchemaValidatorJSTest that inherits from this.
21 class JSONSchemaValidatorTestBase : public testing::Test { 21 class JSONSchemaValidatorTestBase : public testing::Test {
22 public: 22 public:
23 enum ValidatorType { 23 JSONSchemaValidatorTestBase();
24 CPP = 1,
25 JS = 2
26 };
27
28 explicit JSONSchemaValidatorTestBase(ValidatorType type);
29 24
30 void RunTests(); 25 void RunTests();
31 26
32 protected: 27 protected:
33 virtual void ExpectValid(const std::string& test_source, 28 virtual void ExpectValid(const std::string& test_source,
34 base::Value* instance, 29 base::Value* instance,
35 base::DictionaryValue* schema, 30 base::DictionaryValue* schema,
36 base::ListValue* types) = 0; 31 base::ListValue* types) = 0;
37 32
38 virtual void ExpectNotValid(const std::string& test_source, 33 virtual void ExpectNotValid(const std::string& test_source,
(...skipping 10 matching lines...) Expand all
49 void TestChoices(); 44 void TestChoices();
50 void TestExtends(); 45 void TestExtends();
51 void TestObject(); 46 void TestObject();
52 void TestTypeReference(); 47 void TestTypeReference();
53 void TestArrayTuple(); 48 void TestArrayTuple();
54 void TestArrayNonTuple(); 49 void TestArrayNonTuple();
55 void TestString(); 50 void TestString();
56 void TestNumber(); 51 void TestNumber();
57 void TestTypeClassifier(); 52 void TestTypeClassifier();
58 void TestTypes(); 53 void TestTypes();
59
60 ValidatorType type_;
61 }; 54 };
62 55
63 #endif // COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_ 56 #endif // COMPONENTS_JSON_SCHEMA_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698