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 <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 452 } |
453 | 453 |
454 // Test that Binding<X> applies the correct validators and they don't | 454 // Test that Binding<X> applies the correct validators and they don't |
455 // conflict with each other: | 455 // conflict with each other: |
456 // - MessageHeaderValidator | 456 // - MessageHeaderValidator |
457 // - X::RequestValidator_ | 457 // - X::RequestValidator_ |
458 TEST_F(ValidationIntegrationTest, Binding) { | 458 TEST_F(ValidationIntegrationTest, Binding) { |
459 IntegrationTestInterfaceImpl interface_impl; | 459 IntegrationTestInterfaceImpl interface_impl; |
460 Binding<IntegrationTestInterface> binding( | 460 Binding<IntegrationTestInterface> binding( |
461 &interface_impl, | 461 &interface_impl, |
462 MakeRequest<IntegrationTestInterface>(testee_endpoint().Pass())); | 462 InterfaceRequest<IntegrationTestInterface>(testee_endpoint().Pass())); |
463 binding.internal_router()->EnableTestingMode(); | 463 binding.internal_router()->EnableTestingMode(); |
464 | 464 |
465 mojo::internal::MessageValidatorList validators; | 465 mojo::internal::MessageValidatorList validators; |
466 validators.push_back(std::unique_ptr<MessageValidator>( | 466 validators.push_back(std::unique_ptr<MessageValidator>( |
467 new mojo::internal::MessageHeaderValidator)); | 467 new mojo::internal::MessageHeaderValidator)); |
468 validators.push_back(std::unique_ptr<MessageValidator>( | 468 validators.push_back(std::unique_ptr<MessageValidator>( |
469 new typename IntegrationTestInterface::RequestValidator_)); | 469 new typename IntegrationTestInterface::RequestValidator_)); |
470 | 470 |
471 RunValidationTests("integration_intf_rqst", validators, | 471 RunValidationTests("integration_intf_rqst", validators, |
472 test_message_receiver()); | 472 test_message_receiver()); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 static_cast<StructWithEnum::EnumWithin>(2))); | 538 static_cast<StructWithEnum::EnumWithin>(2))); |
539 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue( | 539 EXPECT_TRUE(StructWithEnum::EnumWithin_IsValidValue( |
540 static_cast<StructWithEnum::EnumWithin>(3))); | 540 static_cast<StructWithEnum::EnumWithin>(3))); |
541 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue( | 541 EXPECT_FALSE(StructWithEnum::EnumWithin_IsValidValue( |
542 static_cast<StructWithEnum::EnumWithin>(4))); | 542 static_cast<StructWithEnum::EnumWithin>(4))); |
543 } | 543 } |
544 | 544 |
545 } // namespace | 545 } // namespace |
546 } // namespace test | 546 } // namespace test |
547 } // namespace mojo | 547 } // namespace mojo |
OLD | NEW |