Chromium Code Reviews| 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 class MediaRouteTest : public ::testing::Test { | |
| 11 protected: | |
| 12 MediaRouteTest() {} | |
| 13 ~MediaRouteTest() override {} | |
| 14 | |
| 15 private: | |
| 16 DISALLOW_COPY_AND_ASSIGN(MediaRouteTest); | |
| 17 }; | |
| 18 | |
| 19 | |
| 20 // Tests the == operator. | |
| 21 TEST_F(MediaRouteTest, Equals) { | |
| 22 MediaRoute route1("routeId1", | |
| 23 ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); | |
|
mark a. foltz
2015/03/04 06:22:59
Can we use ForPresentationUrl or ForTabId instead?
| |
| 24 | |
| 25 // Same as route1. | |
| 26 MediaRoute route2("routeId1", | |
| 27 ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); | |
| 28 EXPECT_EQ(route1, route2); | |
| 29 | |
| 30 // The ID is different from route1's. | |
| 31 MediaRoute route3("routeId2", | |
| 32 ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); | |
| 33 EXPECT_NE(route1, route3); | |
| 34 | |
| 35 // The MediaSource is different from route1's. | |
| 36 MediaRoute route4("routeId2", | |
| 37 ForDesktopMediaSource(), "sinkId", "Description", false); | |
| 38 EXPECT_NE(route1, route4); | |
| 39 | |
| 40 // The sink ID is different from route1's. | |
| 41 MediaRoute route5("routeId2", | |
| 42 ForCastAppMediaSource("DialApp"), "anotherSinkId", "Description", false); | |
| 43 EXPECT_NE(route1, route5); | |
| 44 } | |
| 45 | |
| 46 } // namespace media_router | |
| OLD | NEW |