| Index: chrome/test/data/extensions/json_schema_test.js
|
| ===================================================================
|
| --- chrome/test/data/extensions/json_schema_test.js (revision 65777)
|
| +++ chrome/test/data/extensions/json_schema_test.js (working copy)
|
| @@ -419,6 +419,25 @@
|
| [formatError("numberFiniteNotNan", ["-Infinity"]),
|
| formatError("numberMinValue", [schema.minimum])
|
| ]);
|
| +
|
| + // 0 casts to bool differently, so it's important to test
|
| + // BUG=53990.
|
| + var zero_min_schema = {
|
| + 'minimum': 0,
|
| + 'maximum': 100
|
| + };
|
| + assertNotValid("Number", -1, zero_min_schema,
|
| + [formatError("numberMinValue", [zero_min_schema.minimum])]);
|
| + assertValid("Number", 0, zero_min_schema);
|
| +
|
| + var zero_max_schema = {
|
| + 'minimum': -20,
|
| + 'maximum': '0'
|
| + };
|
| + assertNotValid("Number", 1, zero_max_schema,
|
| + [formatError("numberMaxValue", [zero_max_schema.maximum])]);
|
| + assertValid("Number", 0, zero_max_schema);
|
| +
|
| }
|
|
|
| function testType() {
|
| @@ -461,4 +480,10 @@
|
| [formatError("invalidType", ["null", "undefined"])]);
|
| assertNotValid("Type", {}, {type: "function"},
|
| [formatError("invalidType", ["function", "object"])]);
|
| + // Values outside of the range of an integer weren't being tested
|
| + // BUG=53990.
|
| + assertNotValid("Type", 1e10, {type: "integer"},
|
| + [formatError("invalidType", ["integer", "number"])]);
|
| + assertNotValid("Type", -1e10, {type: "integer"},
|
| + [formatError("invalidType", ["integer", "number"])]);
|
| }
|
|
|