| Index: mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| index c15ff0291a7b74d3df324f98c6ad333d626bdc10..b56580f1fbd185a152772b69a6b2d965cef97954 100644
|
| --- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| +++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
|
| @@ -371,6 +371,18 @@ TEST_F(ValidationTest, Conformance) {
|
| RunValidationTests("conformance_", validators.GetHead());
|
| }
|
|
|
| +// This test is similar to Conformance test but its goal is specifically
|
| +// do bounds-check testing of message validation. For example we test the
|
| +// detection of off-by-one errors in method ordinals.
|
| +TEST_F(ValidationTest, BoundsCheck) {
|
| + DummyMessageReceiver dummy_receiver;
|
| + mojo::internal::FilterChain validators(&dummy_receiver);
|
| + validators.Append<mojo::internal::MessageHeaderValidator>();
|
| + validators.Append<BoundsCheckTestInterface::RequestValidator_>();
|
| +
|
| + RunValidationTests("boundscheck_", validators.GetHead());
|
| +}
|
| +
|
| // This test is similar to the Conformance test but for responses.
|
| TEST_F(ValidationTest, ResponseConformance) {
|
| DummyMessageReceiver dummy_receiver;
|
| @@ -381,6 +393,16 @@ TEST_F(ValidationTest, ResponseConformance) {
|
| RunValidationTests("resp_conformance_", validators.GetHead());
|
| }
|
|
|
| +// This test is similar to the BoundsCheck test but for responses.
|
| +TEST_F(ValidationTest, ResponseBoundsCheck) {
|
| + DummyMessageReceiver dummy_receiver;
|
| + mojo::internal::FilterChain validators(&dummy_receiver);
|
| + validators.Append<mojo::internal::MessageHeaderValidator>();
|
| + validators.Append<BoundsCheckTestInterface::ResponseValidator_>();
|
| +
|
| + RunValidationTests("resp_boundscheck_", validators.GetHead());
|
| +}
|
| +
|
| // Test that InterfacePtr<X> applies the correct validators and they don't
|
| // conflict with each other:
|
| // - MessageHeaderValidator
|
|
|