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

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

Issue 2343013002: [Presentation API] (MR side) 1-UA: notify receiver page when receiver connection becomes available (Closed)
Patch Set: resolve code review comments from Derek Created 4 years, 3 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const SendMessageCallback& send_message_cb) override { 139 const SendMessageCallback& send_message_cb) override {
140 SendMessageRawPtr(render_process_id, render_frame_id, session, 140 SendMessageRawPtr(render_process_id, render_frame_id, session,
141 message_request.release(), send_message_cb); 141 message_request.release(), send_message_cb);
142 } 142 }
143 MOCK_METHOD4(ListenForConnectionStateChange, 143 MOCK_METHOD4(ListenForConnectionStateChange,
144 void(int render_process_id, 144 void(int render_process_id,
145 int render_frame_id, 145 int render_frame_id,
146 const content::PresentationSessionInfo& connection, 146 const content::PresentationSessionInfo& connection,
147 const content::PresentationConnectionStateChangedCallback& 147 const content::PresentationConnectionStateChangedCallback&
148 state_changed_cb)); 148 state_changed_cb));
149 MOCK_METHOD1(RegisterReceiverAvailableCallback,
150 void(const content::ReceiverConnectionAvailableCallback&));
151 MOCK_METHOD3(RegisterOffscreenPresentationClient,
152 void(int render_process_id,
153 int render_frame_id,
154 OffscreenPresentationClient*));
149 155
150 void set_screen_availability_listening_supported(bool value) { 156 void set_screen_availability_listening_supported(bool value) {
151 screen_availability_listening_supported_ = value; 157 screen_availability_listening_supported_ = value;
152 } 158 }
153 159
154 private: 160 private:
155 bool screen_availability_listening_supported_ = true; 161 bool screen_availability_listening_supported_ = true;
156 }; 162 };
157 163
158 class MockPresentationServiceClient 164 class MockPresentationServiceClient
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 mock_delegate_.set_screen_availability_listening_supported(false); 863 mock_delegate_.set_screen_availability_listening_supported(false);
858 GURL url(kPresentationUrl1); 864 GURL url(kPresentationUrl1);
859 base::RunLoop run_loop; 865 base::RunLoop run_loop;
860 EXPECT_CALL(mock_client_, OnScreenAvailabilityNotSupported(url)) 866 EXPECT_CALL(mock_client_, OnScreenAvailabilityNotSupported(url))
861 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 867 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
862 ListenForScreenAvailabilityAndWait(kPresentationUrl1, false); 868 ListenForScreenAvailabilityAndWait(kPresentationUrl1, false);
863 run_loop.Run(); 869 run_loop.Run();
864 } 870 }
865 871
866 } // namespace content 872 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698