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

Side by Side Diff: chrome/browser/media/router/offscreen_presentation_manager_unittest.cc

Issue 2737413003: [Presentation API] Remove references to presentation sessions. (Closed)
Patch Set: Update PresentationServiceDelegateImpl unittest 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 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), 42 : render_frame_host_id_(1, 1),
43 presentation_url_(kPresentationUrl), 43 presentation_url_(kPresentationUrl),
44 route_("route_1", 44 route_("route_1",
45 MediaSource("source_1"), 45 MediaSource("source_1"),
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 EXPECT_FALSE(manager()->GetRoute(kPresentationId)); 321 EXPECT_FALSE(manager()->GetRoute(kPresentationId));
322 content::PresentationConnectionPtr controller; 322 content::PresentationConnectionPtr controller;
323 RegisterController(std::move(controller)); 323 RegisterController(std::move(controller));
324 324
325 auto* actual_route = manager()->GetRoute(kPresentationId); 325 auto* actual_route = manager()->GetRoute(kPresentationId);
326 EXPECT_TRUE(actual_route); 326 EXPECT_TRUE(actual_route);
327 EXPECT_TRUE(route.Equals(*actual_route)); 327 EXPECT_TRUE(route.Equals(*actual_route));
328 } 328 }
329 329
330 } // namespace media_router 330 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698