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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp

Issue 2471263003: [Presentation API] (4th)(1-UA blink side) Add WebPresentationConnection and WebPresentationConnecti… (Closed)
Patch Set: rebase Created 4 years, 1 month 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: 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..4ef162f815be7d8d2ecc42a0d0e93d183ee5e1d9 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>
@@ -80,6 +82,16 @@ class MockWebPresentationClient : public WebPresentationClient {
MOCK_METHOD1(setDefaultPresentationUrls, void(const WebVector<WebURL>&));
};
+class MockWebPresentationConnectionProxy
+ : public WebPresentationConnectionProxy {
+ public:
+ MOCK_METHOD1(SetSourceConnection, void(blink::WebPresentationConnection*));
+
mark a. foltz 2016/11/16 01:16:39 Nit: extra newlines between declarations here
zhaobin 2016/11/23 22:52:29 Done.
+ 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 +99,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());
+ }
};
class PresentationReceiverTest : public ::testing::Test {

Powered by Google App Engine
This is Rietveld 408576698