| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { | 115 TEST_F(PresentationConnectionProxyTest, TestControllerConnectionCallsClose) { |
| 116 base::RunLoop run_loop; | 116 base::RunLoop run_loop; |
| 117 EXPECT_CALL(*controller_connection_, | 117 EXPECT_CALL(*controller_connection_, didClose()); |
| 118 didChangeState(blink::WebPresentationConnectionState::Closed)); | 118 EXPECT_CALL(*receiver_connection_, didClose()); |
| 119 EXPECT_CALL(*receiver_connection_, | |
| 120 didChangeState(blink::WebPresentationConnectionState::Closed)); | |
| 121 controller_connection_proxy_->close(); | 119 controller_connection_proxy_->close(); |
| 122 run_loop.RunUntilIdle(); | 120 run_loop.RunUntilIdle(); |
| 123 } | 121 } |
| 124 | 122 |
| 125 TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) { | 123 TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) { |
| 126 base::RunLoop run_loop; | 124 base::RunLoop run_loop; |
| 127 EXPECT_CALL(*controller_connection_, | 125 EXPECT_CALL(*controller_connection_, didClose()); |
| 128 didChangeState(blink::WebPresentationConnectionState::Closed)); | 126 EXPECT_CALL(*receiver_connection_, didClose()); |
| 129 EXPECT_CALL(*receiver_connection_, | |
| 130 didChangeState(blink::WebPresentationConnectionState::Closed)); | |
| 131 receiver_connection_proxy_->close(); | 127 receiver_connection_proxy_->close(); |
| 132 run_loop.RunUntilIdle(); | 128 run_loop.RunUntilIdle(); |
| 133 } | 129 } |
| 134 | 130 |
| 135 } // namespace content | 131 } // namespace content |
| OLD | NEW |