Index: components/json_schema/json_schema_validator.cc |
diff --git a/components/json_schema/json_schema_validator.cc b/components/json_schema/json_schema_validator.cc |
index eadba17b06b8be6e2128015a6ae0fc066d02d0bf..18558d0e111213bd789ac96633b8bc43afaaa53f 100644 |
--- a/components/json_schema/json_schema_validator.cc |
+++ b/components/json_schema/json_schema_validator.cc |
@@ -162,7 +162,10 @@ bool IsValidSchema(const base::DictionaryValue* dict, |
return false; |
} |
- if (!it.value().IsType(entry->type)) { |
+ // Integer can be converted to double. |
+ if (!(it.value().IsType(entry->type) || |
+ (it.value().IsType(base::Value::TYPE_INTEGER) && |
+ entry->type == base::Value::TYPE_DOUBLE))) { |
*error = base::StringPrintf("Invalid value for %s attribute", |
it.key().c_str()); |
return false; |