OLD | NEW |
(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 |
OLD | NEW |