| 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_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace media_router { | 24 namespace media_router { |
| 25 | 25 |
| 26 class MediaRouterMojoImpl; | 26 class MediaRouterMojoImpl; |
| 27 | 27 |
| 28 class MockMediaRouteProvider : public interfaces::MediaRouteProvider { | 28 class MockMediaRouteProvider : public interfaces::MediaRouteProvider { |
| 29 public: | 29 public: |
| 30 MockMediaRouteProvider(); | 30 MockMediaRouteProvider(); |
| 31 ~MockMediaRouteProvider() override; | 31 ~MockMediaRouteProvider() override; |
| 32 | 32 |
| 33 MOCK_METHOD8(CreateRoute, | 33 MOCK_METHOD8(CreateRoute, |
| 34 void(const mojo::String& source_urn, | 34 void(const std::string& source_urn, |
| 35 const mojo::String& sink_id, | 35 const std::string& sink_id, |
| 36 const mojo::String& presentation_id, | 36 const std::string& presentation_id, |
| 37 const mojo::String& origin, | 37 const std::string& origin, |
| 38 int tab_id, | 38 int tab_id, |
| 39 int64_t timeout_secs, | 39 int64_t timeout_secs, |
| 40 bool incognito, | 40 bool incognito, |
| 41 const CreateRouteCallback& callback)); | 41 const CreateRouteCallback& callback)); |
| 42 MOCK_METHOD7(JoinRoute, | 42 MOCK_METHOD7(JoinRoute, |
| 43 void(const mojo::String& source_urn, | 43 void(const std::string& source_urn, |
| 44 const mojo::String& presentation_id, | 44 const std::string& presentation_id, |
| 45 const mojo::String& origin, | 45 const std::string& origin, |
| 46 int tab_id, | 46 int tab_id, |
| 47 int64_t timeout_secs, | 47 int64_t timeout_secs, |
| 48 bool incognito, | 48 bool incognito, |
| 49 const JoinRouteCallback& callback)); | 49 const JoinRouteCallback& callback)); |
| 50 MOCK_METHOD8(ConnectRouteByRouteId, | 50 MOCK_METHOD8(ConnectRouteByRouteId, |
| 51 void(const mojo::String& source_urn, | 51 void(const std::string& source_urn, |
| 52 const mojo::String& route_id, | 52 const std::string& route_id, |
| 53 const mojo::String& presentation_id, | 53 const std::string& presentation_id, |
| 54 const mojo::String& origin, | 54 const std::string& origin, |
| 55 int tab_id, | 55 int tab_id, |
| 56 int64_t timeout_secs, | 56 int64_t timeout_secs, |
| 57 bool incognito, | 57 bool incognito, |
| 58 const JoinRouteCallback& callback)); | 58 const JoinRouteCallback& callback)); |
| 59 MOCK_METHOD1(DetachRoute, void(const mojo::String& route_id)); | 59 MOCK_METHOD1(DetachRoute, void(const std::string& route_id)); |
| 60 MOCK_METHOD2(TerminateRoute, void(const mojo::String& route_id, | 60 MOCK_METHOD2(TerminateRoute, void(const std::string& route_id, |
| 61 const TerminateRouteCallback& callback)); | 61 const TerminateRouteCallback& callback)); |
| 62 MOCK_METHOD1(StartObservingMediaSinks, void(const mojo::String& source)); | 62 MOCK_METHOD1(StartObservingMediaSinks, void(const std::string& source)); |
| 63 MOCK_METHOD1(StopObservingMediaSinks, void(const mojo::String& source)); | 63 MOCK_METHOD1(StopObservingMediaSinks, void(const std::string& source)); |
| 64 MOCK_METHOD3(SendRouteMessage, | 64 MOCK_METHOD3(SendRouteMessage, |
| 65 void(const mojo::String& media_route_id, | 65 void(const std::string& media_route_id, |
| 66 const mojo::String& message, | 66 const std::string& message, |
| 67 const SendRouteMessageCallback& callback)); | 67 const SendRouteMessageCallback& callback)); |
| 68 void SendRouteBinaryMessage( | 68 void SendRouteBinaryMessage( |
| 69 const mojo::String& media_route_id, | 69 const std::string& media_route_id, |
| 70 mojo::Array<uint8_t> data, | 70 const std::vector<uint8_t>& data, |
| 71 const SendRouteMessageCallback& callback) override { | 71 const SendRouteMessageCallback& callback) override { |
| 72 SendRouteBinaryMessageInternal(media_route_id, data.storage(), callback); | 72 SendRouteBinaryMessageInternal(media_route_id, data, callback); |
| 73 } | 73 } |
| 74 MOCK_METHOD3(SendRouteBinaryMessageInternal, | 74 MOCK_METHOD3(SendRouteBinaryMessageInternal, |
| 75 void(const mojo::String& media_route_id, | 75 void(const std::string& media_route_id, |
| 76 const std::vector<uint8_t>& data, | 76 const std::vector<uint8_t>& data, |
| 77 const SendRouteMessageCallback& callback)); | 77 const SendRouteMessageCallback& callback)); |
| 78 MOCK_METHOD1(StartListeningForRouteMessages, | 78 MOCK_METHOD1(StartListeningForRouteMessages, |
| 79 void(const mojo::String& route_id)); | 79 void(const std::string& route_id)); |
| 80 MOCK_METHOD1(StopListeningForRouteMessages, | 80 MOCK_METHOD1(StopListeningForRouteMessages, |
| 81 void(const mojo::String& route_id)); | 81 void(const std::string& route_id)); |
| 82 MOCK_METHOD1(OnPresentationSessionDetached, | 82 MOCK_METHOD1(OnPresentationSessionDetached, |
| 83 void(const mojo::String& route_id)); | 83 void(const std::string& route_id)); |
| 84 MOCK_METHOD1(StartObservingMediaRoutes, void(const mojo::String& source)); | 84 MOCK_METHOD1(StartObservingMediaRoutes, void(const std::string& source)); |
| 85 MOCK_METHOD1(StopObservingMediaRoutes, void(const mojo::String& source)); | 85 MOCK_METHOD1(StopObservingMediaRoutes, void(const std::string& source)); |
| 86 MOCK_METHOD0(EnableMdnsDiscovery, void()); | 86 MOCK_METHOD0(EnableMdnsDiscovery, void()); |
| 87 MOCK_METHOD1(UpdateMediaSinks, void(const mojo::String& source)); | 87 MOCK_METHOD1(UpdateMediaSinks, void(const std::string& source)); |
| 88 void SearchSinks( | 88 void SearchSinks( |
| 89 const mojo::String& sink_id, | 89 const std::string& sink_id, |
| 90 const mojo::String& media_source, | 90 const std::string& media_source, |
| 91 interfaces::SinkSearchCriteriaPtr search_criteria, | 91 interfaces::SinkSearchCriteriaPtr search_criteria, |
| 92 const SearchSinksCallback& callback) override { | 92 const SearchSinksCallback& callback) override { |
| 93 SearchSinks_(sink_id, media_source, search_criteria, callback); | 93 SearchSinks_(sink_id, media_source, search_criteria, callback); |
| 94 } | 94 } |
| 95 MOCK_METHOD4(SearchSinks_, | 95 MOCK_METHOD4(SearchSinks_, |
| 96 void(const mojo::String& sink_id, | 96 void(const std::string& sink_id, |
| 97 const mojo::String& media_source, | 97 const std::string& media_source, |
| 98 interfaces::SinkSearchCriteriaPtr& search_criteria, | 98 interfaces::SinkSearchCriteriaPtr& search_criteria, |
| 99 const SearchSinksCallback& callback)); | 99 const SearchSinksCallback& callback)); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); | 102 DISALLOW_COPY_AND_ASSIGN(MockMediaRouteProvider); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 class MockEventPageTracker : public extensions::EventPageTracker { | 105 class MockEventPageTracker : public extensions::EventPageTracker { |
| 106 public: | 106 public: |
| 107 MockEventPageTracker(); | 107 MockEventPageTracker(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 scoped_refptr<extensions::Extension> extension_; | 144 scoped_refptr<extensions::Extension> extension_; |
| 145 std::unique_ptr<MediaRouterMojoImpl> mock_media_router_; | 145 std::unique_ptr<MediaRouterMojoImpl> mock_media_router_; |
| 146 std::unique_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; | 146 std::unique_ptr<mojo::Binding<interfaces::MediaRouteProvider>> binding_; |
| 147 | 147 |
| 148 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); | 148 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoTest); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace media_router | 151 } // namespace media_router |
| 152 | 152 |
| 153 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ | 153 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_TEST_H_ |
| OLD | NEW |