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

Side by Side Diff: content/renderer/presentation/test_presentation_connection.h

Issue 2730123003: [Presentation API] Add layout test for connection.close() and fix test failures (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_ 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_
6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_ 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nConnection.h" 11 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio nConnection.h"
12 12
13 namespace blink {
14 enum class WebPresentationConnectionCloseReason;
15 class WebString;
16 }
17
13 namespace content { 18 namespace content {
14 19
15 class TestPresentationConnection : public blink::WebPresentationConnection { 20 class TestPresentationConnection : public blink::WebPresentationConnection {
16 public: 21 public:
17 TestPresentationConnection(); 22 TestPresentationConnection();
18 ~TestPresentationConnection(); 23 ~TestPresentationConnection();
19 24
20 void bindProxy( 25 void bindProxy(
21 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy) override; 26 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy) override;
22 27
23 MOCK_METHOD1(didReceiveTextMessage, void(const blink::WebString& message)); 28 MOCK_METHOD1(didReceiveTextMessage, void(const blink::WebString& message));
24 MOCK_METHOD2(didReceiveBinaryMessage, 29 MOCK_METHOD2(didReceiveBinaryMessage,
25 void(const uint8_t* data, size_t length)); 30 void(const uint8_t* data, size_t length));
26 MOCK_METHOD1(didChangeState, void(blink::WebPresentationConnectionState)); 31 MOCK_METHOD1(didChangeState, void(blink::WebPresentationConnectionState));
32 MOCK_METHOD2(didClose,
33 void(blink::WebPresentationConnectionCloseReason,
34 const blink::WebString& message));
27 35
28 blink::WebPresentationConnectionProxy* proxy(); 36 blink::WebPresentationConnectionProxy* proxy();
29 37
30 private: 38 private:
31 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy_; 39 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy_;
32 }; 40 };
33 41
34 } // namespace content 42 } // namespace content
35 43
36 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_ 44 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_CONNECTION_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698