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

Side by Side Diff: content/renderer/presentation/presentation_connection_proxy_unittest.cc

Issue 2730123003: [Presentation API] Add layout test for connection.close() and fix test failures (Closed)
Patch Set: Created 3 years, 9 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 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_,
118 didChangeState(blink::WebPresentationConnectionState::Closed)); 118 didClose(blink::WebPresentationConnectionCloseReason::Closed,
119 blink::WebString("")));
119 EXPECT_CALL(*receiver_connection_, 120 EXPECT_CALL(*receiver_connection_,
120 didChangeState(blink::WebPresentationConnectionState::Closed)); 121 didClose(blink::WebPresentationConnectionCloseReason::Closed,
122 blink::WebString("")));
121 controller_connection_proxy_->close(); 123 controller_connection_proxy_->close();
122 run_loop.RunUntilIdle(); 124 run_loop.RunUntilIdle();
123 } 125 }
124 126
125 TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) { 127 TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) {
126 base::RunLoop run_loop; 128 base::RunLoop run_loop;
127 EXPECT_CALL(*controller_connection_, 129 EXPECT_CALL(*controller_connection_,
128 didChangeState(blink::WebPresentationConnectionState::Closed)); 130 didClose(blink::WebPresentationConnectionCloseReason::Closed,
131 blink::WebString("")));
129 EXPECT_CALL(*receiver_connection_, 132 EXPECT_CALL(*receiver_connection_,
130 didChangeState(blink::WebPresentationConnectionState::Closed)); 133 didClose(blink::WebPresentationConnectionCloseReason::Closed,
134 blink::WebString("")));
131 receiver_connection_proxy_->close(); 135 receiver_connection_proxy_->close();
132 run_loop.RunUntilIdle(); 136 run_loop.RunUntilIdle();
133 } 137 }
134 138
135 } // namespace content 139 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698