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

Unified Diff: content/renderer/presentation/presentation_connection_proxy_unittest.cc

Issue 2874483002: [Presentation API] Remove closed connections from PresentationConnectionList (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/presentation/presentation_connection_proxy_unittest.cc
diff --git a/content/renderer/presentation/presentation_connection_proxy_unittest.cc b/content/renderer/presentation/presentation_connection_proxy_unittest.cc
index 189beb4931ccdf1fea7977e13d864c3179a8f12a..002989380768807bf2ed00d6ef069cc1dc337d66 100644
--- a/content/renderer/presentation/presentation_connection_proxy_unittest.cc
+++ b/content/renderer/presentation/presentation_connection_proxy_unittest.cc
@@ -6,6 +6,7 @@
#include <utility>
#include "base/run_loop.h"
+#include "base/test/mock_callback.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/renderer/presentation/presentation_connection_proxy.h"
#include "content/renderer/presentation/test_presentation_connection.h"
@@ -32,8 +33,8 @@ class PresentationConnectionProxyTest : public ::testing::Test {
new ControllerConnectionProxy(controller_connection_.get());
controller_connection_->BindProxy(
base::WrapUnique(controller_connection_proxy_));
- receiver_connection_proxy_ =
- new ReceiverConnectionProxy(receiver_connection_.get());
+ receiver_connection_proxy_ = new ReceiverConnectionProxy(
+ receiver_connection_.get(), mock_connection_closed_callback_.Get());
receiver_connection_->BindProxy(
base::WrapUnique(receiver_connection_proxy_));
@@ -64,6 +65,8 @@ class PresentationConnectionProxyTest : public ::testing::Test {
std::unique_ptr<TestPresentationConnection> receiver_connection_;
ControllerConnectionProxy* controller_connection_proxy_;
ReceiverConnectionProxy* receiver_connection_proxy_;
+ base::MockCallback<ReceiverConnectionProxy::OnConnectionClosedCallback>
+ mock_connection_closed_callback_;
private:
content::TestBrowserThreadBundle thread_bundle_;
@@ -106,6 +109,7 @@ TEST_F(PresentationConnectionProxyTest, TestControllerConnectionCallsClose) {
base::RunLoop run_loop;
EXPECT_CALL(*controller_connection_, DidClose());
EXPECT_CALL(*receiver_connection_, DidClose());
+ EXPECT_CALL(mock_connection_closed_callback_, Run());
controller_connection_proxy_->Close();
run_loop.RunUntilIdle();
}
@@ -114,6 +118,7 @@ TEST_F(PresentationConnectionProxyTest, TestReceiverConnectionCallsClose) {
base::RunLoop run_loop;
EXPECT_CALL(*controller_connection_, DidClose());
EXPECT_CALL(*receiver_connection_, DidClose());
+ EXPECT_CALL(mock_connection_closed_callback_, Run());
receiver_connection_proxy_->Close();
run_loop.RunUntilIdle();
}

Powered by Google App Engine
This is Rietveld 408576698