Index: third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
index d8f6e39197310d7fb9ff91298e9c1a207cf981ae..42696208eb5bbbc0d9592eb6f94d58a48fd7e12d 100644 |
--- a/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
+++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
@@ -9,6 +9,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/testing/DummyPageHolder.h" |
#include "modules/presentation/PresentationConnectionList.h" |
+#include "public/platform/modules/presentation/WebPresentationClient.h" |
#include "public/platform/modules/presentation/WebPresentationConnectionClient.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -73,7 +74,7 @@ using ::testing::StrictMock; |
TEST_F(PresentationReceiverTest, NoConnectionUnresolvedConnectionList) |
{ |
V8TestingScope scope; |
- auto receiver = new PresentationReceiver(&scope.frame()); |
+ auto receiver = new PresentationReceiver(&scope.frame(), nullptr); |
mark a. foltz
2016/09/15 16:53:18
Please add a test case with a mock WebPresentation
|
auto eventHandler = new StrictMock<MockEventListener>(); |
addConnectionavailableEventListener(eventHandler, receiver); |
@@ -88,7 +89,7 @@ TEST_F(PresentationReceiverTest, NoConnectionUnresolvedConnectionList) |
TEST_F(PresentationReceiverTest, OneConnectionResolvedConnectionListNoEvent) |
{ |
V8TestingScope scope; |
- auto receiver = new PresentationReceiver(&scope.frame()); |
+ auto receiver = new PresentationReceiver(&scope.frame(), nullptr); |
auto eventHandler = new StrictMock<MockEventListener>(); |
addConnectionavailableEventListener(eventHandler, receiver); |
@@ -98,7 +99,7 @@ TEST_F(PresentationReceiverTest, OneConnectionResolvedConnectionListNoEvent) |
// Receive first connection. |
auto connectionClient = new TestWebPresentationConnectionClient(); |
- receiver->onConnectionReceived(connectionClient); |
+ receiver->onReceiverConnectionAvailable(connectionClient); |
verifyConnectionListPropertyState(ScriptPromisePropertyBase::Resolved, receiver); |
verifyConnectionListSize(1, receiver); |
@@ -107,7 +108,7 @@ TEST_F(PresentationReceiverTest, OneConnectionResolvedConnectionListNoEvent) |
TEST_F(PresentationReceiverTest, TwoConnectionsFireOnconnectionavailableEvent) |
{ |
V8TestingScope scope; |
- auto receiver = new PresentationReceiver(&scope.frame()); |
+ auto receiver = new PresentationReceiver(&scope.frame(), nullptr); |
StrictMock<MockEventListener>* eventHandler = new StrictMock<MockEventListener>(); |
addConnectionavailableEventListener(eventHandler, receiver); |
@@ -116,11 +117,11 @@ TEST_F(PresentationReceiverTest, TwoConnectionsFireOnconnectionavailableEvent) |
receiver->connectionList(scope.getScriptState()); |
// Receive first connection. |
auto connectionClient1 = new TestWebPresentationConnectionClient(); |
- receiver->onConnectionReceived(connectionClient1); |
+ receiver->onReceiverConnectionAvailable(connectionClient1); |
// Receive second connection. |
auto connectionClient2 = new TestWebPresentationConnectionClient(); |
- receiver->onConnectionReceived(connectionClient2); |
+ receiver->onReceiverConnectionAvailable(connectionClient2); |
verifyConnectionListSize(2, receiver); |
} |
@@ -128,7 +129,7 @@ TEST_F(PresentationReceiverTest, TwoConnectionsFireOnconnectionavailableEvent) |
TEST_F(PresentationReceiverTest, TwoConnectionsNoEvent) |
{ |
V8TestingScope scope; |
- auto receiver = new PresentationReceiver(&scope.frame()); |
+ auto receiver = new PresentationReceiver(&scope.frame(), nullptr); |
StrictMock<MockEventListener>* eventHandler = new StrictMock<MockEventListener>(); |
addConnectionavailableEventListener(eventHandler, receiver); |
@@ -136,11 +137,11 @@ TEST_F(PresentationReceiverTest, TwoConnectionsNoEvent) |
// Receive first connection. |
auto connectionClient1 = new TestWebPresentationConnectionClient(); |
- receiver->onConnectionReceived(connectionClient1); |
+ receiver->onReceiverConnectionAvailable(connectionClient1); |
// Receive second connection. |
auto connectionClient2 = new TestWebPresentationConnectionClient(); |
- receiver->onConnectionReceived(connectionClient2); |
+ receiver->onReceiverConnectionAvailable(connectionClient2); |
receiver->connectionList(scope.getScriptState()); |
verifyConnectionListPropertyState(ScriptPromisePropertyBase::Resolved, receiver); |