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 "chrome/browser/media/router/presentation_media_sinks_observer.h" | 5 #include "chrome/browser/media/router/presentation_media_sinks_observer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/stringprintf.h" | |
11 #include "chrome/browser/media/router/media_source_helper.h" | 10 #include "chrome/browser/media/router/media_source_helper.h" |
12 #include "chrome/browser/media/router/mock_media_router.h" | 11 #include "chrome/browser/media/router/mock_media_router.h" |
13 #include "chrome/browser/media/router/mock_screen_availability_listener.h" | 12 #include "chrome/browser/media/router/mock_screen_availability_listener.h" |
14 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
15 #include "content/public/browser/presentation_screen_availability_listener.h" | 14 #include "content/public/browser/presentation_screen_availability_listener.h" |
16 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
17 | 16 |
18 using testing::_; | 17 using testing::_; |
19 using testing::Mock; | 18 using testing::Mock; |
20 using testing::Return; | 19 using testing::Return; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 observer_->OnSinksReceived(result); | 83 observer_->OnSinksReceived(result); |
85 EXPECT_TRUE(Mock::VerifyAndClearExpectations(&listener_)); | 84 EXPECT_TRUE(Mock::VerifyAndClearExpectations(&listener_)); |
86 | 85 |
87 // |listener_| should get result since it changed to false. | 86 // |listener_| should get result since it changed to false. |
88 EXPECT_CALL(listener_, OnScreenAvailabilityChanged(false)).Times(1); | 87 EXPECT_CALL(listener_, OnScreenAvailabilityChanged(false)).Times(1); |
89 observer_->OnSinksReceived(std::vector<MediaSink>()); | 88 observer_->OnSinksReceived(std::vector<MediaSink>()); |
90 EXPECT_TRUE(Mock::VerifyAndClearExpectations(&listener_)); | 89 EXPECT_TRUE(Mock::VerifyAndClearExpectations(&listener_)); |
91 } | 90 } |
92 | 91 |
93 } // namespace media_router | 92 } // namespace media_router |
OLD | NEW |