Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: mojo/public/cpp/bindings/tests/validation_unittest.cc

Issue 1660403003: Mojo C++ bindings: Rename InterfaceInfoPtr -> InterfaceHandle (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: using {{InterfaceName}}Handle = InterfaceHandle<{{InterfaceName}}> Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698