OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" | 9 #include "chrome/browser/media/router/offscreen_presentation_manager.h" |
10 #include "chrome/browser/media/router/test_helper.h" | 10 #include "chrome/browser/media/router/test_helper.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
14 | 14 |
15 using testing::_; | 15 using testing::_; |
16 | 16 |
17 namespace media_router { | 17 namespace media_router { |
18 | 18 |
19 namespace { | 19 namespace { |
20 const char kPresentationId[] = "presentationId"; | 20 const char kPresentationId[] = "presentationId"; |
21 const char kPresentationId2[] = "presentationId2"; | 21 const char kPresentationId2[] = "presentationId2"; |
22 const char kPresentationUrl[] = "http://www.example.com/presentation.html"; | 22 const char kPresentationUrl[] = "http://www.example.com/presentation.html"; |
23 } // namespace | 23 } // namespace |
24 | 24 |
25 class MockReceiverConnectionAvailableCallback { | 25 class MockReceiverConnectionAvailableCallback { |
26 public: | 26 public: |
27 void OnReceiverConnectionAvailable( | 27 void OnReceiverConnectionAvailable( |
28 const content::PresentationSessionInfo& session_info, | 28 const content::PresentationInfo& presentation_info, |
29 content::PresentationConnectionPtr controller_conn, | 29 content::PresentationConnectionPtr controller_conn, |
30 content::PresentationConnectionRequest receiver_conn_request) { | 30 content::PresentationConnectionRequest receiver_conn_request) { |
31 OnReceiverConnectionAvailableRaw(session_info, controller_conn.get()); | 31 OnReceiverConnectionAvailableRaw(presentation_info, controller_conn.get()); |
32 } | 32 } |
33 | 33 |
34 MOCK_METHOD2(OnReceiverConnectionAvailableRaw, | 34 MOCK_METHOD2(OnReceiverConnectionAvailableRaw, |
35 void(const content::PresentationSessionInfo&, | 35 void(const content::PresentationInfo&, |
36 blink::mojom::PresentationConnection*)); | 36 blink::mojom::PresentationConnection*)); |
37 }; | 37 }; |
38 | 38 |
39 class OffscreenPresentationManagerTest : public ::testing::Test { | 39 class OffscreenPresentationManagerTest : public ::testing::Test { |
40 public: | 40 public: |
41 OffscreenPresentationManagerTest() | 41 OffscreenPresentationManagerTest() |
42 : render_frame_host_id_(1, 1), presentation_url_(kPresentationUrl) {} | 42 : render_frame_host_id_(1, 1), presentation_url_(kPresentationUrl) {} |
43 | 43 |
44 OffscreenPresentationManager* manager() { return &manager_; } | 44 OffscreenPresentationManager* manager() { return &manager_; } |
45 | 45 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 .Times(1); | 292 .Times(1); |
293 RegisterReceiver(kPresentationId2, receiver_callback2); | 293 RegisterReceiver(kPresentationId2, receiver_callback2); |
294 | 294 |
295 VerifyPresentationsSize(2); | 295 VerifyPresentationsSize(2); |
296 | 296 |
297 UnregisterReceiver(); | 297 UnregisterReceiver(); |
298 VerifyPresentationsSize(1); | 298 VerifyPresentationsSize(1); |
299 } | 299 } |
300 | 300 |
301 } // namespace media_router | 301 } // namespace media_router |
OLD | NEW |