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

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

Issue 1118843003: Remove some InterfacePtr<> methods which directly deal with message pipe handles. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 validators.Append<BoundsCheckTestInterface::ResponseValidator_>(); 401 validators.Append<BoundsCheckTestInterface::ResponseValidator_>();
402 402
403 RunValidationTests("resp_boundscheck_", validators.GetHead()); 403 RunValidationTests("resp_boundscheck_", validators.GetHead());
404 } 404 }
405 405
406 // Test that InterfacePtr<X> applies the correct validators and they don't 406 // Test that InterfacePtr<X> applies the correct validators and they don't
407 // conflict with each other: 407 // conflict with each other:
408 // - MessageHeaderValidator 408 // - MessageHeaderValidator
409 // - X::ResponseValidator_ 409 // - X::ResponseValidator_
410 TEST_F(ValidationIntegrationTest, InterfacePtr) { 410 TEST_F(ValidationIntegrationTest, InterfacePtr) {
411 IntegrationTestInterfacePtr interface_ptr = 411 IntegrationTestInterfacePtr interface_ptr = MakeProxy(
412 MakeProxy<IntegrationTestInterface>(testee_endpoint().Pass()); 412 InterfacePtrInfo<IntegrationTestInterface>(testee_endpoint().Pass(), 0u));
413 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode(); 413 interface_ptr.internal_state()->router_for_testing()->EnableTestingMode();
414 414
415 RunValidationTests("integration_intf_resp", test_message_receiver()); 415 RunValidationTests("integration_intf_resp", test_message_receiver());
416 RunValidationTests("integration_msghdr", test_message_receiver()); 416 RunValidationTests("integration_msghdr", test_message_receiver());
417 } 417 }
418 418
419 // Test that Binding<X> applies the correct validators and they don't 419 // Test that Binding<X> applies the correct validators and they don't
420 // conflict with each other: 420 // conflict with each other:
421 // - MessageHeaderValidator 421 // - MessageHeaderValidator
422 // - X::RequestValidator_ 422 // - X::RequestValidator_
423 TEST_F(ValidationIntegrationTest, Binding) { 423 TEST_F(ValidationIntegrationTest, Binding) {
424 IntegrationTestInterfaceImpl interface_impl; 424 IntegrationTestInterfaceImpl interface_impl;
425 Binding<IntegrationTestInterface> binding( 425 Binding<IntegrationTestInterface> binding(
426 &interface_impl, 426 &interface_impl,
427 MakeRequest<IntegrationTestInterface>(testee_endpoint().Pass())); 427 MakeRequest<IntegrationTestInterface>(testee_endpoint().Pass()));
428 binding.internal_router()->EnableTestingMode(); 428 binding.internal_router()->EnableTestingMode();
429 429
430 RunValidationTests("integration_intf_rqst", test_message_receiver()); 430 RunValidationTests("integration_intf_rqst", test_message_receiver());
431 RunValidationTests("integration_msghdr", test_message_receiver()); 431 RunValidationTests("integration_msghdr", test_message_receiver());
432 } 432 }
433 433
434 } // namespace 434 } // namespace
435 } // namespace test 435 } // namespace test
436 } // namespace mojo 436 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698