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

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

Issue 2714783002: [Presentation API] (browser side) Implement reconnect() for 1-UA mode (Closed)
Patch Set: remove duplicate unit tests Created 3 years, 10 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"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 EXPECT_CALL(receiver_callback2, OnReceiverConnectionAvailableRaw(_, _)) 291 EXPECT_CALL(receiver_callback2, OnReceiverConnectionAvailableRaw(_, _))
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 TEST_F(OffscreenPresentationManagerTest, TestIsOffscreenPresentation) {
302 EXPECT_FALSE(manager()->IsOffscreenPresentation(kPresentationId));
303 content::PresentationConnectionPtr controller1;
304 RegisterController(kPresentationId, std::move(controller1));
305 EXPECT_TRUE(manager()->IsOffscreenPresentation(kPresentationId));
306 }
307
308 TEST_F(OffscreenPresentationManagerTest, TestRegisterAndGetRoute) {
309 MediaSource source("source_1");
310 MediaRoute route("route_1", source, "sink_1", "", false, "", false);
311
312 EXPECT_FALSE(manager()->GetRoute(kPresentationId));
313 manager()->RegisterOffscreenPresentationRoute(kPresentationId,
314 GURL(kPresentationUrl), route);
315 auto* actual_route = manager()->GetRoute(kPresentationId);
316 EXPECT_TRUE(actual_route);
317 EXPECT_TRUE(route.Equals(*actual_route));
318 }
319
301 } // namespace media_router 320 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698