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

Unified Diff: chrome/test/data/extensions/json_schema_test.js

Issue 5018002: Fixes a crash when entering a negative index with chrome.tabs.move .... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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,24 @@
[formatError("numberFiniteNotNan", ["-Infinity"]),
formatError("numberMinValue", [schema.minimum])
]);
+
+ //0 casts to bool differently, so it's important to test
Aaron Boodman 2010/11/16 20:21:28 Space after "//". Add a period to the end of the c
+ 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() {

Powered by Google App Engine
This is Rietveld 408576698