| OLD | NEW |
| 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 #include "components/json_schema/json_schema_validator_unittest_base.h" | 5 #include "components/json_schema/json_schema_validator_unittest_base.h" |
| 6 | 6 |
| 7 #include <cfloat> | 7 #include <cfloat> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return NULL; | 51 return NULL; |
| 52 if (!result->IsType(type)) { | 52 if (!result->IsType(type)) { |
| 53 ADD_FAILURE() << "Expected type " << type << ", got: " << result->GetType(); | 53 ADD_FAILURE() << "Expected type " << type << ", got: " << result->GetType(); |
| 54 return NULL; | 54 return NULL; |
| 55 } | 55 } |
| 56 return result.release(); | 56 return result.release(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 base::ListValue* LoadList(const std::string& filename) { | 59 base::ListValue* LoadList(const std::string& filename) { |
| 60 return static_cast<base::ListValue*>( | 60 return static_cast<base::ListValue*>( |
| 61 LoadValue(filename, base::Value::TYPE_LIST)); | 61 LoadValue(filename, base::Value::Type::LIST)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 base::DictionaryValue* LoadDictionary(const std::string& filename) { | 64 base::DictionaryValue* LoadDictionary(const std::string& filename) { |
| 65 return static_cast<base::DictionaryValue*>( | 65 return static_cast<base::DictionaryValue*>( |
| 66 LoadValue(filename, base::Value::TYPE_DICTIONARY)); | 66 LoadValue(filename, base::Value::Type::DICTIONARY)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 | 71 |
| 72 JSONSchemaValidatorTestBase::JSONSchemaValidatorTestBase() { | 72 JSONSchemaValidatorTestBase::JSONSchemaValidatorTestBase() { |
| 73 } | 73 } |
| 74 | 74 |
| 75 void JSONSchemaValidatorTestBase::RunTests() { | 75 void JSONSchemaValidatorTestBase::RunTests() { |
| 76 TestComplex(); | 76 TestComplex(); |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 schema::kInteger)); | 758 schema::kInteger)); |
| 759 | 759 |
| 760 schema->SetString(schema::kType, schema::kNull); | 760 schema->SetString(schema::kType, schema::kNull); |
| 761 ExpectNotValid( | 761 ExpectNotValid( |
| 762 TEST_SOURCE, | 762 TEST_SOURCE, |
| 763 std::unique_ptr<base::Value>(new base::FundamentalValue(false)).get(), | 763 std::unique_ptr<base::Value>(new base::FundamentalValue(false)).get(), |
| 764 schema.get(), NULL, std::string(), | 764 schema.get(), NULL, std::string(), |
| 765 JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType, | 765 JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType, |
| 766 schema::kNull, schema::kBoolean)); | 766 schema::kNull, schema::kBoolean)); |
| 767 } | 767 } |
| OLD | NEW |