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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7c42b6df917327d7a44f1ec7d1684ef7a248bd43
--- /dev/null
+++ b/chrome/browser/media/router/media_route_unittest.cc
@@ -0,0 +1,43 @@
+// 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 "chrome/browser/media/router/media_sink.h"
+#include "chrome/browser/media/router/media_source_helper.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace media_router {
+
+// Tests the == operator to ensure that only route ID equality is being checked.
+TEST(MediaRouteTest, Equals) {
+ MediaRoute route1("routeId1", ForCastAppMediaSource("DialApp"),
+ MediaSink("sinkId", "sinkName"),
+ "Description", false);
+
+ // Same as route1 with different sink ID.
+ MediaRoute route2("routeId1", ForCastAppMediaSource("DialApp"),
+ MediaSink("differentSinkId", "different sink"),
+ "Description", false);
+ EXPECT_TRUE(route1.Equals(route2));
+
+ // Same as route1 with different description.
+ MediaRoute route3("routeId1", ForCastAppMediaSource("DialApp"),
+ MediaSink("sinkId", "sinkName"),
+ "differentDescription", false);
+ EXPECT_TRUE(route1.Equals(route3));
+
+ // Same as route1 with different is_local.
+ MediaRoute route4("routeId1", ForCastAppMediaSource("DialApp"),
+ MediaSink("sinkId", "sinkName"),
+ "Description", true);
+ EXPECT_TRUE(route1.Equals(route4));
+
+ // The ID is different from route1's.
+ MediaRoute route5("routeId2", ForCastAppMediaSource("DialApp"),
+ MediaSink("sinkId", "sinkName"),
+ "Description", false);
+ EXPECT_FALSE(route1.Equals(route5));
+}
+
+} // namespace media_router
« 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