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

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

Issue 1132903002: [MediaRouter] Add implementation of PresentationServiceDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/media/router/media_route.h" 5 #include "chrome/browser/media/router/media_route.h"
6 #include "chrome/browser/media/router/media_sink.h" 6 #include "chrome/browser/media/router/media_sink.h"
7 #include "chrome/browser/media/router/media_source_helper.h" 7 #include "chrome/browser/media/router/media_source_helper.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 9
10 namespace media_router { 10 namespace media_router {
11 11
12 // Tests the == operator to ensure that only route ID equality is being checked. 12 // Tests the == operator to ensure that only route ID equality is being checked.
13 TEST(MediaRouteTest, Equals) { 13 TEST(MediaRouteTest, Equals) {
14 MediaRoute route1("routeId1", ForCastAppMediaSource("DialApp"), 14 MediaRoute route1("routeId1", MediaSourceForCastApp("DialApp"),
15 MediaSink("sinkId", "sinkName"), 15 MediaSink("sinkId", "sinkName"), "Description", false);
16 "Description", false);
17 16
18 // Same as route1 with different sink ID. 17 // Same as route1 with different sink ID.
19 MediaRoute route2("routeId1", ForCastAppMediaSource("DialApp"), 18 MediaRoute route2("routeId1", MediaSourceForCastApp("DialApp"),
20 MediaSink("differentSinkId", "different sink"), 19 MediaSink("differentSinkId", "different sink"),
21 "Description", false); 20 "Description", false);
22 EXPECT_TRUE(route1.Equals(route2)); 21 EXPECT_TRUE(route1.Equals(route2));
23 22
24 // Same as route1 with different description. 23 // Same as route1 with different description.
25 MediaRoute route3("routeId1", ForCastAppMediaSource("DialApp"), 24 MediaRoute route3("routeId1", MediaSourceForCastApp("DialApp"),
26 MediaSink("sinkId", "sinkName"), 25 MediaSink("sinkId", "sinkName"), "differentDescription",
27 "differentDescription", false); 26 false);
28 EXPECT_TRUE(route1.Equals(route3)); 27 EXPECT_TRUE(route1.Equals(route3));
29 28
30 // Same as route1 with different is_local. 29 // Same as route1 with different is_local.
31 MediaRoute route4("routeId1", ForCastAppMediaSource("DialApp"), 30 MediaRoute route4("routeId1", MediaSourceForCastApp("DialApp"),
32 MediaSink("sinkId", "sinkName"), 31 MediaSink("sinkId", "sinkName"), "Description", true);
33 "Description", true);
34 EXPECT_TRUE(route1.Equals(route4)); 32 EXPECT_TRUE(route1.Equals(route4));
35 33
36 // The ID is different from route1's. 34 // The ID is different from route1's.
37 MediaRoute route5("routeId2", ForCastAppMediaSource("DialApp"), 35 MediaRoute route5("routeId2", MediaSourceForCastApp("DialApp"),
38 MediaSink("sinkId", "sinkName"), 36 MediaSink("sinkId", "sinkName"), "Description", false);
39 "Description", false);
40 EXPECT_FALSE(route1.Equals(route5)); 37 EXPECT_FALSE(route1.Equals(route5));
41 } 38 }
42 39
43 } // namespace media_router 40 } // namespace media_router
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698