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

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

Issue 2714693002: [Presentation API] Use connection proxy to change connection state to 'closed' (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 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 class MockPresentationConnection : public blink::mojom::PresentationConnection { 181 class MockPresentationConnection : public blink::mojom::PresentationConnection {
182 public: 182 public:
183 void OnMessage(blink::mojom::ConnectionMessagePtr message, 183 void OnMessage(blink::mojom::ConnectionMessagePtr message,
184 const base::Callback<void(bool)>& send_message_cb) override { 184 const base::Callback<void(bool)>& send_message_cb) override {
185 OnConnectionMessageReceived(*message); 185 OnConnectionMessageReceived(*message);
186 } 186 }
187 MOCK_METHOD1(OnConnectionMessageReceived, 187 MOCK_METHOD1(OnConnectionMessageReceived,
188 void(const blink::mojom::ConnectionMessage& message)); 188 void(const blink::mojom::ConnectionMessage& message));
189 MOCK_METHOD1(DidChangeState, void(PresentationConnectionState state)); 189 MOCK_METHOD1(DidChangeState, void(PresentationConnectionState state));
190 MOCK_METHOD0(OnClose, void());
190 }; 191 };
191 192
192 class MockPresentationServiceClient 193 class MockPresentationServiceClient
193 : public blink::mojom::PresentationServiceClient { 194 : public blink::mojom::PresentationServiceClient {
194 public: 195 public:
195 MOCK_METHOD2(OnScreenAvailabilityUpdated, 196 MOCK_METHOD2(OnScreenAvailabilityUpdated,
196 void(const GURL& url, bool available)); 197 void(const GURL& url, bool available));
197 MOCK_METHOD2(OnConnectionStateChanged, 198 MOCK_METHOD2(OnConnectionStateChanged,
198 void(const content::PresentationSessionInfo& connection, 199 void(const content::PresentationSessionInfo& connection,
199 PresentationConnectionState new_state)); 200 PresentationConnectionState new_state));
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 mock_delegate_.set_screen_availability_listening_supported(false); 925 mock_delegate_.set_screen_availability_listening_supported(false);
925 base::RunLoop run_loop; 926 base::RunLoop run_loop;
926 EXPECT_CALL(mock_client_, 927 EXPECT_CALL(mock_client_,
927 OnScreenAvailabilityNotSupported(presentation_url1_)) 928 OnScreenAvailabilityNotSupported(presentation_url1_))
928 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 929 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
929 ListenForScreenAvailabilityAndWait(presentation_url1_, false); 930 ListenForScreenAvailabilityAndWait(presentation_url1_, false);
930 run_loop.Run(); 931 run_loop.Run();
931 } 932 }
932 933
933 } // namespace content 934 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698