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

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

Issue 949293004: Add media router common classes and unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring GN files up to date. Created 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/media/router/media_route.h"
6 #include "chrome/browser/media/router/media_sink.h"
7 #include "chrome/browser/media/router/media_source_helper.h"
8 #include "testing/gmock/include/gmock/gmock.h"
9
10 namespace media_router {
11
12 // Tests the == operator to ensure that only route ID equality is being checked.
13 TEST(MediaRouteTest, Equals) {
14 MediaRoute route1("routeId1", ForCastAppMediaSource("DialApp"),
15 MediaSink("sinkId", "sinkName"),
16 "Description", false);
17
18 // Same as route1 with different sink ID.
19 MediaRoute route2("routeId1", ForCastAppMediaSource("DialApp"),
20 MediaSink("differentSinkId", "different sink"),
21 "Description", false);
22 EXPECT_TRUE(route1.Equals(route2));
23
24 // Same as route1 with different description.
25 MediaRoute route3("routeId1", ForCastAppMediaSource("DialApp"),
26 MediaSink("sinkId", "sinkName"),
27 "differentDescription", false);
28 EXPECT_TRUE(route1.Equals(route3));
29
30 // Same as route1 with different is_local.
31 MediaRoute route4("routeId1", ForCastAppMediaSource("DialApp"),
32 MediaSink("sinkId", "sinkName"),
33 "Description", true);
34 EXPECT_TRUE(route1.Equals(route4));
35
36 // The ID is different from route1's.
37 MediaRoute route5("routeId2", ForCastAppMediaSource("DialApp"),
38 MediaSink("sinkId", "sinkName"),
39 "Description", false);
40 EXPECT_FALSE(route1.Equals(route5));
41 }
42
43 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_route_id.h ('k') | chrome/browser/media/router/media_router.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698