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

Issue 4673001: Implements a C++ version of JSONSchemaValidator. (Closed)

Created:
10 years, 1 month ago by Aaron Boodman
Modified:
9 years, 6 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Implements a C++ version of JSONSchemaValidator. BUG=none TEST=covered by unit tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=65867

Patch Set 1 #

Patch Set 2 : more tests #

Total comments: 20

Patch Set 3 : all done #

Total comments: 7

Patch Set 4 : added more tests, addressed comments #

Patch Set 5 : warnings #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1545 lines, -0 lines) Patch
M chrome/chrome_common.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/common/json_schema_validator.h View 1 2 3 4 1 chunk +212 lines, -0 lines 0 comments Download
A chrome/common/json_schema_validator.cc View 1 2 3 1 chunk +500 lines, -0 lines 2 comments Download
A chrome/common/json_schema_validator_unittest.cc View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/common/json_schema_validator_unittest_base.h View 1 2 3 1 chunk +59 lines, -0 lines 0 comments Download
A chrome/common/json_schema_validator_unittest_base.cc View 1 2 3 1 chunk +643 lines, -0 lines 2 comments Download
A chrome/test/data/json_schema_validator/array_tuple_schema.json View 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/json_schema_validator/choices_schema.json View 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/json_schema_validator/complex_instance.json View 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/json_schema_validator/complex_schema.json View 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/data/json_schema_validator/enum_schema.json View 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/test/data/json_schema_validator/reference_types.json View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Aaron Boodman
I'm still finishing up the tests for this, but I think it's worth starting to ...
10 years, 1 month ago (2010-11-08 10:42:55 UTC) #1
Aaron Boodman
Forgot to say, the reason for the odd test setup is because there is also ...
10 years, 1 month ago (2010-11-08 10:44:34 UTC) #2
asargent_no_longer_on_chrome
I haven't finished looking at the test code yet, but wanted to send out my ...
10 years, 1 month ago (2010-11-08 23:47:18 UTC) #3
Erik does not do reviews
I didn't look at style too deeply or the details of all of the tests ...
10 years, 1 month ago (2010-11-09 18:34:21 UTC) #4
Aaron Boodman
Regarding the presence of fatal checks of schema-well-formedness: I think I would like to handle ...
10 years, 1 month ago (2010-11-10 19:03:35 UTC) #5
Erik does not do reviews
I'll defer to Antony on the rest. LGTM
10 years, 1 month ago (2010-11-10 19:11:06 UTC) #6
asargent_no_longer_on_chrome
10 years, 1 month ago (2010-11-11 01:30:49 UTC) #7
lgtm w/ a couple of final nits

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
File chrome/common/json_schema_validator.cc (right):

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
chrome/common/json_schema_validator.cc:177: types_[id] = schema;
I see you added the CHECK above in the constructor for non-duplicate type
definitions in the incoming types ListValue, but can't you still run into the
problem here for sub-definitions further down in the tree?

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
chrome/common/json_schema_validator.cc:244: // validations failed.
don't you mean "We only want to know if any of the validations succeeded" ?

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
File chrome/common/json_schema_validator_unittest_base.cc (right):

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
chrome/common/json_schema_validator_unittest_base.cc:59: }
nit: add "  // namespace" after the closing brace here

http://codereview.chromium.org/4673001/diff/18001/chrome/common/json_schema_v...
chrome/common/json_schema_validator_unittest_base.cc:229:
CHECK(schema->GetDictionary("properties", &properties));
If you are unlucky a certain chromium engineer who watches test code in CL's
closely will spot that you are using CHECK here and request you change it to
EXPECT or ASSERT. (Remaining nameless in case that might trigger a gmail filter)
Perhaps better to fend it off by changing in advance. :)

Powered by Google App Engine
This is Rietveld 408576698