OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/media/router/media_route.h" | 8 #include "chrome/browser/media/router/media_route.h" |
9 #include "chrome/browser/media/router/media_source_helper.h" | 9 #include "chrome/browser/media/router/media_source_helper.h" |
10 #include "chrome/browser/media/router/mock_media_router.h" | 10 #include "chrome/browser/media/router/mock_media_router.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 const char kPresentationUrl[] = "http://foo"; | 22 const char kPresentationUrl[] = "http://foo"; |
23 const char kPresentationId[] = "presentationId"; | 23 const char kPresentationId[] = "presentationId"; |
24 | 24 |
25 MediaRoute::Id CreateRouteId(const char* presentation_url, | 25 MediaRoute::Id CreateRouteId(const char* presentation_url, |
26 const char* presentation_id) { | 26 const char* presentation_id) { |
27 return base::StringPrintf("urn:x-org.chromium:media:route:%s/cast-sink1/%s", | 27 return base::StringPrintf("urn:x-org.chromium:media:route:%s/cast-sink1/%s", |
28 presentation_id, presentation_url); | 28 presentation_id, presentation_url); |
29 } | 29 } |
30 | 30 |
31 MATCHER_P(PresentationSessionInfoEquals, expected, "") { | 31 MATCHER_P(PresentationSessionInfoEquals, expected, "") { |
32 return arg.presentation_url == expected.presentation_url & | 32 return arg.presentation_url == expected.presentation_url && |
33 arg.presentation_id == expected.presentation_id; | 33 arg.presentation_id == expected.presentation_id; |
34 } | 34 } |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 class PresentationSessionStateObserverTest : public testing::Test { | 38 class PresentationSessionStateObserverTest : public testing::Test { |
39 public: | 39 public: |
40 PresentationSessionStateObserverTest() {} | 40 PresentationSessionStateObserverTest() {} |
41 ~PresentationSessionStateObserverTest() override {} | 41 ~PresentationSessionStateObserverTest() override {} |
42 | 42 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 MediaSink("sinkId", "A sink"), "Description", true)); | 123 MediaSink("sinkId", "A sink"), "Description", true)); |
124 observer_->OnRoutesUpdated(routes); | 124 observer_->OnRoutesUpdated(routes); |
125 | 125 |
126 // |route_id| is no longer being tracked. | 126 // |route_id| is no longer being tracked. |
127 observer_->Reset(); | 127 observer_->Reset(); |
128 EXPECT_TRUE(testing::Mock::VerifyAndClearExpectations(this)); | 128 EXPECT_TRUE(testing::Mock::VerifyAndClearExpectations(this)); |
129 observer_->OnRoutesUpdated(std::vector<MediaRoute>()); | 129 observer_->OnRoutesUpdated(std::vector<MediaRoute>()); |
130 } | 130 } |
131 | 131 |
132 } // namespace media_router | 132 } // namespace media_router |
OLD | NEW |