OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 EXPECT_EQ("hey", description); | 764 EXPECT_EQ("hey", description); |
765 quit_closure.Run(); | 765 quit_closure.Run(); |
766 }, | 766 }, |
767 run_loop.QuitClosure())); | 767 run_loop.QuitClosure())); |
768 | 768 |
769 calc_impl.binding()->CloseWithReason(42u, "hey"); | 769 calc_impl.binding()->CloseWithReason(42u, "hey"); |
770 | 770 |
771 run_loop.Run(); | 771 run_loop.Run(); |
772 } | 772 } |
773 | 773 |
| 774 TEST_F(InterfacePtrTest, InterfaceRequestResetWithReason) { |
| 775 math::CalculatorPtr calc; |
| 776 auto request = GetProxy(&calc); |
| 777 |
| 778 base::RunLoop run_loop; |
| 779 calc.set_connection_error_with_reason_handler(base::Bind( |
| 780 [](const base::Closure& quit_closure, uint32_t custom_reason, |
| 781 const std::string& description) { |
| 782 EXPECT_EQ(88u, custom_reason); |
| 783 EXPECT_EQ("greetings", description); |
| 784 quit_closure.Run(); |
| 785 }, |
| 786 run_loop.QuitClosure())); |
| 787 |
| 788 request.ResetWithReason(88u, "greetings"); |
| 789 |
| 790 run_loop.Run(); |
| 791 } |
| 792 |
774 } // namespace | 793 } // namespace |
775 } // namespace test | 794 } // namespace test |
776 } // namespace mojo | 795 } // namespace mojo |
OLD | NEW |