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

Side by Side Diff: content/browser/presentation/presentation_service_impl_unittest.cc

Issue 2471263003: [Presentation API] (4th)(1-UA blink side) Add WebPresentationConnection and WebPresentationConnecti… (Closed)
Patch Set: rebase and resolve code review comments from haraken Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/browser/presentation/presentation_service_impl.h" 5 #include "content/browser/presentation/presentation_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 class MockPresentationConnection : public blink::mojom::PresentationConnection { 187 class MockPresentationConnection : public blink::mojom::PresentationConnection {
188 public: 188 public:
189 void SetTargetConnection( 189 void SetTargetConnection(
190 blink::mojom::PresentationConnectionPtr connection) override { 190 blink::mojom::PresentationConnectionPtr connection) override {
191 SetTargetConnection(*connection); 191 SetTargetConnection(*connection);
192 } 192 }
193 MOCK_METHOD1(SetTargetConnection, 193 MOCK_METHOD1(SetTargetConnection,
194 void(blink::mojom::PresentationConnection& connection)); 194 void(blink::mojom::PresentationConnection& connection));
195 195
196 void OnMessage(blink::mojom::SessionMessagePtr message) override { 196 void OnMessage(blink::mojom::SessionMessagePtr message,
197 const base::Callback<void(bool)>& send_message_cb) override {
197 OnConnectionMessageReceived(*message); 198 OnConnectionMessageReceived(*message);
198 } 199 }
199 MOCK_METHOD1(OnConnectionMessageReceived, 200 MOCK_METHOD1(OnConnectionMessageReceived,
200 void(const blink::mojom::SessionMessage& message)); 201 void(const blink::mojom::SessionMessage& message));
202 MOCK_METHOD1(DidChangeState,
203 void(blink::mojom::PresentationConnectionState state));
201 }; 204 };
202 205
203 class MockPresentationServiceClient 206 class MockPresentationServiceClient
204 : public blink::mojom::PresentationServiceClient { 207 : public blink::mojom::PresentationServiceClient {
205 public: 208 public:
206 MOCK_METHOD2(OnScreenAvailabilityUpdated, 209 MOCK_METHOD2(OnScreenAvailabilityUpdated,
207 void(const GURL& url, bool available)); 210 void(const GURL& url, bool available));
208 void OnConnectionStateChanged( 211 void OnConnectionStateChanged(
209 blink::mojom::PresentationSessionInfoPtr connection, 212 blink::mojom::PresentationSessionInfoPtr connection,
210 blink::mojom::PresentationConnectionState new_state) override { 213 blink::mojom::PresentationConnectionState new_state) override {
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 mock_delegate_.set_screen_availability_listening_supported(false); 966 mock_delegate_.set_screen_availability_listening_supported(false);
964 base::RunLoop run_loop; 967 base::RunLoop run_loop;
965 EXPECT_CALL(mock_client_, 968 EXPECT_CALL(mock_client_,
966 OnScreenAvailabilityNotSupported(presentation_url1_)) 969 OnScreenAvailabilityNotSupported(presentation_url1_))
967 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 970 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
968 ListenForScreenAvailabilityAndWait(presentation_url1_, false); 971 ListenForScreenAvailabilityAndWait(presentation_url1_, false);
969 run_loop.Run(); 972 run_loop.Run();
970 } 973 }
971 974
972 } // namespace content 975 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/BUILD.gn » ('j') | content/renderer/presentation/presentation_connection_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698