Chromium Code Reviews| 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 db0cb6e95dfff5d2cd71fed30bebb5004c1015d9..d7cd232a87b76c56a0a09daee1fffb6b7bfcc571 100644 |
| --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
| +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp |
| @@ -8,10 +8,12 @@ |
| #include "bindings/core/v8/V8BindingForTesting.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/testing/DummyPageHolder.h" |
| +#include "modules/presentation/PresentationConnection.h" |
| #include "modules/presentation/PresentationConnectionList.h" |
| #include "platform/testing/URLTestHelpers.h" |
| #include "public/platform/modules/presentation/WebPresentationClient.h" |
| #include "public/platform/modules/presentation/WebPresentationConnectionClient.h" |
| +#include "public/platform/modules/presentation/WebPresentationConnectionProxy.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include <v8.h> |
| @@ -44,22 +46,25 @@ class MockWebPresentationClient : public WebPresentationClient { |
| const WebString& presentationId, |
| WebPresentationConnectionClientCallbacks*)); |
| - MOCK_METHOD3(sendString, |
| + MOCK_METHOD4(sendString, |
| void(const WebURL& presentationUrl, |
| const WebString& presentationId, |
| - const WebString& message)); |
| + const WebString& message, |
| + const WebPresentationConnectionProxy* proxy)); |
| - MOCK_METHOD4(sendArrayBuffer, |
| + MOCK_METHOD5(sendArrayBuffer, |
| void(const WebURL& presentationUrl, |
| const WebString& presentationId, |
| const uint8_t* data, |
| - size_t length)); |
| + size_t length, |
| + const WebPresentationConnectionProxy* proxy)); |
| - MOCK_METHOD4(sendBlobData, |
| + MOCK_METHOD5(sendBlobData, |
| void(const WebURL& presentationUrl, |
| const WebString& presentationId, |
| const uint8_t* data, |
| - size_t length)); |
| + size_t length, |
| + const WebPresentationConnectionProxy* proxy)); |
| MOCK_METHOD2(closeSession, |
| void(const WebURL& presentationUrl, |
| @@ -80,6 +85,14 @@ class MockWebPresentationClient : public WebPresentationClient { |
| MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&)); |
| }; |
| +class MockWebPresentationConnectionProxy |
| + : public WebPresentationConnectionProxy { |
| + public: |
| + MOCK_METHOD1(SetSourceConnection, void(blink::WebPresentationConnection*)); |
| + MOCK_METHOD1(SendString, void(const blink::WebString& message)); |
| + MOCK_METHOD2(SendArrayBuffer, void(const uint8_t* data, size_t length)); |
| +}; |
| + |
| class TestWebPresentationConnectionClient |
| : public WebPresentationConnectionClient { |
| public: |
| @@ -87,6 +100,10 @@ class TestWebPresentationConnectionClient |
| WebURL getUrl() override { |
| return URLTestHelpers::toKURL("http://www.example.com"); |
| } |
| + std::unique_ptr<WebPresentationConnectionProxy> takeProxy() override { |
| + return std::unique_ptr<WebPresentationConnectionProxy>( |
| + new MockWebPresentationConnectionProxy()); |
|
haraken
2016/11/24 04:49:55
Use wrapUnique.
zhaobin
2016/12/05 20:28:16
Done.
|
| + } |
| }; |
| class PresentationReceiverTest : public ::testing::Test { |