| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 RunValidationTests("resp_boundscheck_", validators, &dummy_receiver); | 429 RunValidationTests("resp_boundscheck_", validators, &dummy_receiver); |
| 430 } | 430 } |
| 431 | 431 |
| 432 // Test that InterfacePtr<X> applies the correct validators and they don't | 432 // Test that InterfacePtr<X> applies the correct validators and they don't |
| 433 // conflict with each other: | 433 // conflict with each other: |
| 434 // - MessageHeaderValidator | 434 // - MessageHeaderValidator |
| 435 // - X::ResponseValidator_ | 435 // - X::ResponseValidator_ |
| 436 TEST_F(ValidationIntegrationTest, InterfacePtr) { | 436 TEST_F(ValidationIntegrationTest, InterfacePtr) { |
| 437 IntegrationTestInterfacePtr interface_ptr = MakeProxy( | 437 IntegrationTestInterfacePtr interface_ptr = MakeProxy( |
| 438 InterfacePtrInfo<IntegrationTestInterface>(testee_endpoint().Pass(), 0u)); | 438 InterfaceHandle<IntegrationTestInterface>(testee_endpoint().Pass(), 0u)); |
| 439 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode(); | 439 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode(); |
| 440 | 440 |
| 441 mojo::internal::MessageValidatorList validators; | 441 mojo::internal::MessageValidatorList validators; |
| 442 validators.push_back(std::unique_ptr<MessageValidator>( | 442 validators.push_back(std::unique_ptr<MessageValidator>( |
| 443 new mojo::internal::MessageHeaderValidator)); | 443 new mojo::internal::MessageHeaderValidator)); |
| 444 validators.push_back(std::unique_ptr<MessageValidator>( | 444 validators.push_back(std::unique_ptr<MessageValidator>( |
| 445 new typename IntegrationTestInterface::ResponseValidator_)); | 445 new typename IntegrationTestInterface::ResponseValidator_)); |
| 446 | 446 |
| 447 RunValidationTests("integration_intf_resp", validators, | 447 RunValidationTests("integration_intf_resp", validators, |
| 448 test_message_receiver()); | 448 test_message_receiver()); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 static_cast<StructWithEnum::EnumWithin>(2))); | 536 static_cast<StructWithEnum::EnumWithin>(2))); |
| 537 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue( | 537 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue( |
| 538 static_cast<StructWithEnum::EnumWithin>(3))); | 538 static_cast<StructWithEnum::EnumWithin>(3))); |
| 539 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue( | 539 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue( |
| 540 static_cast<StructWithEnum::EnumWithin>(4))); | 540 static_cast<StructWithEnum::EnumWithin>(4))); |
| 541 } | 541 } |
| 542 | 542 |
| 543 } // namespace | 543 } // namespace |
| 544 } // namespace test | 544 } // namespace test |
| 545 } // namespace mojo | 545 } // namespace mojo |
| OLD | NEW |