| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 run_loop.Run(); | 1115 run_loop.Run(); |
| 1116 } | 1116 } |
| 1117 | 1117 |
| 1118 other_thread_task_runner->DeleteSoon(FROM_HERE, context); | 1118 other_thread_task_runner->DeleteSoon(FROM_HERE, context); |
| 1119 | 1119 |
| 1120 // Reset the pointer now so the InterfacePtr associated resources can be | 1120 // Reset the pointer now so the InterfacePtr associated resources can be |
| 1121 // deleted before the background thread's message loop is invalidated. | 1121 // deleted before the background thread's message loop is invalidated. |
| 1122 thread_safe_ptr = nullptr; | 1122 thread_safe_ptr = nullptr; |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 class DiscardingAssociatedPingProviderProvider |
| 1126 : public AssociatedPingProviderProvider { |
| 1127 public: |
| 1128 void GetPingProvider( |
| 1129 AssociatedPingProviderAssociatedRequest request) override {} |
| 1130 }; |
| 1131 |
| 1132 TEST_F(AssociatedInterfaceTest, CloseWithoutBindingAssociatedRequest) { |
| 1133 DiscardingAssociatedPingProviderProvider ping_provider_provider; |
| 1134 mojo::Binding<AssociatedPingProviderProvider> binding( |
| 1135 &ping_provider_provider); |
| 1136 auto provider_provider = binding.CreateInterfacePtrAndBind(); |
| 1137 AssociatedPingProviderAssociatedPtr provider; |
| 1138 provider_provider->GetPingProvider( |
| 1139 mojo::MakeRequest(&provider, provider_provider.associated_group())); |
| 1140 PingServiceAssociatedPtr ping; |
| 1141 provider->GetPing( |
| 1142 mojo::MakeRequest(&ping, provider.associated_group())); |
| 1143 base::RunLoop run_loop; |
| 1144 ping.set_connection_error_handler(run_loop.QuitClosure()); |
| 1145 run_loop.Run(); |
| 1146 } |
| 1147 |
| 1125 } // namespace | 1148 } // namespace |
| 1126 } // namespace test | 1149 } // namespace test |
| 1127 } // namespace mojo | 1150 } // namespace mojo |
| OLD | NEW |