Index: chrome/browser/media/router/media_route_unittest.cc |
diff --git a/chrome/browser/media/router/media_route_unittest.cc b/chrome/browser/media/router/media_route_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6834129a388bbe45bb0bcb02b340950bb24875e3 |
--- /dev/null |
+++ b/chrome/browser/media/router/media_route_unittest.cc |
@@ -0,0 +1,46 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/media/router/media_route.h" |
+#include "testing/gmock/include/gmock/gmock.h" |
+ |
+namespace media_router { |
+ |
+class MediaRouteTest : public ::testing::Test { |
+ protected: |
+ MediaRouteTest() {} |
+ ~MediaRouteTest() override {} |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(MediaRouteTest); |
+}; |
+ |
+ |
+// Tests the == operator. |
+TEST_F(MediaRouteTest, Equals) { |
+ MediaRoute route1("routeId1", |
+ ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); |
mark a. foltz
2015/03/04 06:22:59
Can we use ForPresentationUrl or ForTabId instead?
|
+ |
+ // Same as route1. |
+ MediaRoute route2("routeId1", |
+ ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); |
+ EXPECT_EQ(route1, route2); |
+ |
+ // The ID is different from route1's. |
+ MediaRoute route3("routeId2", |
+ ForCastAppMediaSource("DialApp"), "sinkId", "Description", false); |
+ EXPECT_NE(route1, route3); |
+ |
+ // The MediaSource is different from route1's. |
+ MediaRoute route4("routeId2", |
+ ForDesktopMediaSource(), "sinkId", "Description", false); |
+ EXPECT_NE(route1, route4); |
+ |
+ // The sink ID is different from route1's. |
+ MediaRoute route5("routeId2", |
+ ForCastAppMediaSource("DialApp"), "anotherSinkId", "Description", false); |
+ EXPECT_NE(route1, route5); |
+} |
+ |
+} // namespace media_router |