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

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: MediaSource struct is now a class 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 "testing/gmock/include/gmock/gmock.h"
7
8 namespace media_router {
9
10 // Tests the == operator to ensure that only route ID equality is being checked.
11 TEST(MediaRouteTest, Equals) {
12 MediaRoute route1("routeId1", MediaSource::ForCastApp("DialApp"),
13 "sinkId", "Description", false);
14
15 // Same as route1 with different sink ID.
16 MediaRoute route2("routeId1", MediaSource::ForCastApp("DialApp"),
17 "differentSinkId", "Description", false);
18 EXPECT_TRUE(route1.Equals(route2));
19
20 // Same as route1 with different description.
21 MediaRoute route3("routeId1", MediaSource::ForCastApp("DialApp"),
22 "sinkId", "differentDescription", false);
23 EXPECT_TRUE(route1.Equals(route3));
24
25 // Same as route1 with different is_local.
26 MediaRoute route4("routeId1", MediaSource::ForCastApp("DialApp"),
27 "sinkId", "Description", true);
28 EXPECT_TRUE(route1.Equals(route4));
29
30 // The ID is different from route1's.
31 MediaRoute route5("routeId2", MediaSource::ForCastApp("DialApp"),
32 "sinkId", "Description", false);
33 EXPECT_FALSE(route1.Equals(route5));
34 }
35
36 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698