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

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

Issue 2714693002: [Presentation API] Use connection proxy to change connection state to 'closed' (Closed)
Patch Set: fix unittest errors Created 3 years, 10 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_dispatcher_unittest.cc
diff --git a/content/renderer/presentation/presentation_dispatcher_unittest.cc b/content/renderer/presentation/presentation_dispatcher_unittest.cc
index d67f8b9407a47f0a28a30ab608c247d76403abf8..0310bd8adc02d282e2e2608ad95f3c19e3660c44 100644
--- a/content/renderer/presentation/presentation_dispatcher_unittest.cc
+++ b/content/renderer/presentation/presentation_dispatcher_unittest.cc
@@ -110,6 +110,7 @@ class TestPresentationConnectionProxy : public PresentationConnectionProxy {
MOCK_CONST_METHOD2(SendConnectionMessageInternal,
void(blink::mojom::ConnectionMessage*,
const OnMessageCallback&));
+ MOCK_CONST_METHOD0(close, void());
};
class TestPresentationReceiver : public blink::WebPresentationReceiver {
@@ -492,9 +493,12 @@ TEST_F(PresentationDispatcherTest, TestOnReceiverConnectionAvailable) {
TEST_F(PresentationDispatcherTest, TestCloseSession) {
base::RunLoop run_loop;
+ TestPresentationConnection connection;
+ TestPresentationConnectionProxy test_proxy(&connection);
+ EXPECT_CALL(test_proxy, close());
EXPECT_CALL(presentation_service_,
CloseConnection(gurl1_, presentation_id_.utf8()));
- dispatcher_.closeSession(url1_, presentation_id_);
+ dispatcher_.closeSession(url1_, presentation_id_, &test_proxy);
run_loop.RunUntilIdle();
}

Powered by Google App Engine
This is Rietveld 408576698