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

Side by Side 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: Code review feedback 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 unified diff | Download patch
OLDNEW
(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) {
xhwang 2015/03/05 22:28:50 You probably don't need the MediaRouteTest at all.
Kevin M 2015/03/06 23:12:45 Done.
22 MediaRoute route1("routeId1",
23 ForCastAppMediaSource("DialApp"), "sinkId", "Description", false);
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 }
xhwang 2015/03/05 22:28:49 You may also want to cover the case where is_local
Kevin M 2015/03/06 23:12:45 Done.
45
46 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698