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

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: More typedef=>using conversions. Created 5 years, 10 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
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

Powered by Google App Engine
This is Rietveld 408576698