OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdio.h> | 5 #include <stdio.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 364 |
365 TEST_F(ValidationTest, Conformance) { | 365 TEST_F(ValidationTest, Conformance) { |
366 DummyMessageReceiver dummy_receiver; | 366 DummyMessageReceiver dummy_receiver; |
367 mojo::internal::FilterChain validators(&dummy_receiver); | 367 mojo::internal::FilterChain validators(&dummy_receiver); |
368 validators.Append<mojo::internal::MessageHeaderValidator>(); | 368 validators.Append<mojo::internal::MessageHeaderValidator>(); |
369 validators.Append<ConformanceTestInterface::RequestValidator_>(); | 369 validators.Append<ConformanceTestInterface::RequestValidator_>(); |
370 | 370 |
371 RunValidationTests("conformance_", validators.GetHead()); | 371 RunValidationTests("conformance_", validators.GetHead()); |
372 } | 372 } |
373 | 373 |
374 TEST_F(ValidationTest, NotImplemented) { | |
375 DummyMessageReceiver dummy_receiver; | |
376 mojo::internal::FilterChain validators(&dummy_receiver); | |
377 validators.Append<mojo::internal::MessageHeaderValidator>(); | |
378 validators.Append<ConformanceTestInterface::RequestValidator_>(); | |
379 | |
380 RunValidationTests("not_implemented_", validators.GetHead()); | |
381 } | |
382 | |
383 // Test that InterfacePtr<X> applies the correct validators and they don't | 374 // Test that InterfacePtr<X> applies the correct validators and they don't |
384 // conflict with each other: | 375 // conflict with each other: |
385 // - MessageHeaderValidator | 376 // - MessageHeaderValidator |
386 // - X::ResponseValidator_ | 377 // - X::ResponseValidator_ |
387 TEST_F(ValidationIntegrationTest, InterfacePtr) { | 378 TEST_F(ValidationIntegrationTest, InterfacePtr) { |
388 IntegrationTestInterfacePtr interface_ptr = | 379 IntegrationTestInterfacePtr interface_ptr = |
389 MakeProxy<IntegrationTestInterface>(testee_endpoint().Pass()); | 380 MakeProxy<IntegrationTestInterface>(testee_endpoint().Pass()); |
390 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode(); | 381 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode(); |
391 | 382 |
392 RunValidationTests("integration_intf_resp", test_message_receiver()); | 383 RunValidationTests("integration_intf_resp", test_message_receiver()); |
(...skipping 11 matching lines...) Expand all Loading... |
404 MakeRequest<IntegrationTestInterface>(testee_endpoint().Pass())); | 395 MakeRequest<IntegrationTestInterface>(testee_endpoint().Pass())); |
405 binding.internal_router()->EnableTestingMode(); | 396 binding.internal_router()->EnableTestingMode(); |
406 | 397 |
407 RunValidationTests("integration_intf_rqst", test_message_receiver()); | 398 RunValidationTests("integration_intf_rqst", test_message_receiver()); |
408 RunValidationTests("integration_msghdr", test_message_receiver()); | 399 RunValidationTests("integration_msghdr", test_message_receiver()); |
409 } | 400 } |
410 | 401 |
411 } // namespace | 402 } // namespace |
412 } // namespace test | 403 } // namespace test |
413 } // namespace mojo | 404 } // namespace mojo |
OLD | NEW |