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

Side by Side Diff: chrome/common/json_schema_validator_unittest_base.h

Issue 4673001: Implements a C++ version of JSONSchemaValidator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more tests Created 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
6 #define CHROME_COMMON_EXTENSIONS_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
7
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 class DictionaryValue;
11 class ListValue;
12 class Value;
13
14 class JSONSchemaValidatorTestBase : public testing::Test {
15 public:
16 enum ValidatorType {
17 CPP = 1,
18 JS = 2
19 };
20
21 JSONSchemaValidatorTestBase(ValidatorType type);
22
23 void RunTests();
24
25 protected:
26 virtual void ExpectValid(const std::string& test_source,
27 Value* instance, DictionaryValue* schema,
28 ListValue* types) = 0;
29
30 virtual void ExpectNotValid(const std::string& test_source,
31 Value* instance, DictionaryValue* schema,
32 ListValue* types,
33 const std::string& expected_error_path,
34 const std::string& expected_error_message) = 0;
35
36 private:
37 void TestComplex();
38 void TestStringPattern();
39 void TestEnum();
40 void TestChoices();
41 void TestExtends();
42 void TestObject();
43 void TestTypeReference();
44
45 ValidatorType type_;
46 };
47
48 #endif // CHROME_COMMON_EXTENSIONS_JSON_SCHEMA_VALIDATOR_UNITTEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698