OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/public/test/test_browser_thread_bundle.h" | 9 #include "content/public/test/test_browser_thread_bundle.h" |
10 #include "content/renderer/presentation/presentation_connection_proxy.h" | 10 #include "content/renderer/presentation/presentation_connection_proxy.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 })); | 105 })); |
106 | 106 |
107 controller_connection_proxy_->SendConnectionMessage( | 107 controller_connection_proxy_->SendConnectionMessage( |
108 std::move(session_message), | 108 std::move(session_message), |
109 base::Bind( | 109 base::Bind( |
110 &PresentationConnectionProxyTest::ExpectSendConnectionMessageCallback, | 110 &PresentationConnectionProxyTest::ExpectSendConnectionMessageCallback, |
111 base::Unretained(this))); | 111 base::Unretained(this))); |
112 run_loop.RunUntilIdle(); | 112 run_loop.RunUntilIdle(); |
113 } | 113 } |
114 | 114 |
| 115 TEST_F(PresentationConnectionProxyTest, TestControllerConnectionCallsClose) { |
| 116 base::RunLoop run_loop; |
| 117 EXPECT_CALL(*controller_connection_, |
| 118 didChangeState(blink::WebPresentationConnectionState::Closed)); |
| 119 EXPECT_CALL(*receiver_connection_, |
| 120 didChangeState(blink::WebPresentationConnectionState::Closed)); |
| 121 controller_connection_proxy_->close(); |
| 122 run_loop.RunUntilIdle(); |
| 123 } |
| 124 |
| 125 TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) { |
| 126 base::RunLoop run_loop; |
| 127 EXPECT_CALL(*controller_connection_, |
| 128 didChangeState(blink::WebPresentationConnectionState::Closed)); |
| 129 EXPECT_CALL(*receiver_connection_, |
| 130 didChangeState(blink::WebPresentationConnectionState::Closed)); |
| 131 receiver_connection_proxy_->close(); |
| 132 run_loop.RunUntilIdle(); |
| 133 } |
| 134 |
115 } // namespace content | 135 } // namespace content |
OLD | NEW |