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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 class MockMediaRoutesObserver : public MediaRoutesObserver { | 71 class MockMediaRoutesObserver : public MediaRoutesObserver { |
72 public: | 72 public: |
73 explicit MockMediaRoutesObserver(MediaRouter* router, | 73 explicit MockMediaRoutesObserver(MediaRouter* router, |
74 const MediaSource::Id source_id = std::string()); | 74 const MediaSource::Id source_id = std::string()); |
75 ~MockMediaRoutesObserver() override; | 75 ~MockMediaRoutesObserver() override; |
76 | 76 |
77 MOCK_METHOD2(OnRoutesUpdated, void(const std::vector<MediaRoute>& routes, | 77 MOCK_METHOD2(OnRoutesUpdated, void(const std::vector<MediaRoute>& routes, |
78 const std::vector<MediaRoute::Id>& joinable_route_ids)); | 78 const std::vector<MediaRoute::Id>& joinable_route_ids)); |
79 }; | 79 }; |
80 | 80 |
| 81 class MockPresentationConnectionProxy |
| 82 : public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) { |
| 83 public: |
| 84 // PresentationConnectionMessage is move-only. |
| 85 // TODO(crbug.com/729950): Use MOCK_METHOD directly once GMock gets the |
| 86 // move-only type support. |
| 87 MockPresentationConnectionProxy(); |
| 88 ~MockPresentationConnectionProxy() override; |
| 89 void OnMessage(content::PresentationConnectionMessage message, |
| 90 OnMessageCallback cb) { |
| 91 OnMessageInternal(message, cb); |
| 92 } |
| 93 MOCK_METHOD2(OnMessageInternal, |
| 94 void(const content::PresentationConnectionMessage&, |
| 95 OnMessageCallback&)); |
| 96 MOCK_METHOD1(DidChangeState, |
| 97 void(content::PresentationConnectionState state)); |
| 98 MOCK_METHOD0(OnClose, void()); |
| 99 }; |
| 100 |
81 } // namespace media_router | 101 } // namespace media_router |
82 | 102 |
83 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ | 103 #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_ |
OLD | NEW |