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 7b7dcbeee2fe835194379387a7784bfb02dfa185..169ba578f700013b36fe92d484e5abf521473233 100644 |
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc |
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc |
@@ -424,6 +424,18 @@ TEST_F(ValidationTest, ResponseBoundsCheck) { |
RunValidationTests("resp_boundscheck_", &validators); |
} |
+// Test that the client cannot send a message (e.g. a recursively defined |
+// struct) so deep that the validation code blows the stack. The validation code |
+// should check for this case and return a validation error. |
+TEST_F(ValidationTest, RequestMaxRecursionDepth) { |
+ DummyMessageReceiver dummy_receiver; |
+ mojo::FilterChain validators(&dummy_receiver); |
+ validators.Append<mojo::MessageHeaderValidator>(); |
+ validators.Append<ConformanceTestInterface::RequestValidator_>(); |
+ |
+ RunValidationTests("req_max_recursion_depth", &validators); |
yzshen1
2016/09/07 16:51:20
Does it make sense to use the same prefix as other
tibell
2016/09/08 00:03:38
Done.
|
+} |
+ |
// Test that InterfacePtr<X> applies the correct validators and they don't |
// conflict with each other: |
// - MessageHeaderValidator |