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.
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOCK_MEDIA_ROUTER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MOCK_MEDIA_ROUTER_H_
11 #include "chrome/browser/media/router/issue.h"
12 #include "chrome/browser/media/router/media_route.h"
13 #include "chrome/browser/media/router/media_router.h"
14 #include "chrome/browser/media/router/media_sink.h"
15 #include "chrome/browser/media/router/media_source.h"
16 #include "testing/gmock/include/gmock/gmock.h"
18 namespace media_router
{
20 // Media Router mock class. Used for testing purposes.
21 class MockMediaRouter
: public MediaRouter
{
24 virtual ~MockMediaRouter();
26 MOCK_METHOD5(CreateRoute
,
27 void(const MediaSource::Id
& source
,
28 const MediaSink::Id
& sink_id
,
31 const std::vector
<MediaRouteResponseCallback
>& callbacks
));
32 MOCK_METHOD5(JoinRoute
,
33 void(const MediaSource::Id
& source
,
34 const std::string
& presentation_id
,
37 const std::vector
<MediaRouteResponseCallback
>& callbacks
));
38 MOCK_METHOD1(CloseRoute
, void(const MediaRoute::Id
& route_id
));
39 MOCK_METHOD3(SendRouteMessage
,
40 void(const MediaRoute::Id
& route_id
,
41 const std::string
& message
,
42 const SendRouteMessageCallback
& callback
));
43 void SendRouteBinaryMessage(
44 const MediaRoute::Id
& route_id
,
45 scoped_ptr
<std::vector
<uint8
>> data
,
46 const SendRouteMessageCallback
& callback
) override
{
47 SendRouteBinaryMessageInternal(route_id
, data
.get(), callback
);
49 MOCK_METHOD3(SendRouteBinaryMessageInternal
,
50 void(const MediaRoute::Id
& route_id
,
51 std::vector
<uint8
>* data
,
52 const SendRouteMessageCallback
& callback
));
53 MOCK_METHOD1(ClearIssue
, void(const Issue::Id
& issue_id
));
54 MOCK_METHOD1(OnPresentationSessionDetached
,
55 void(const MediaRoute::Id
& route_id
));
56 MOCK_METHOD1(RegisterIssuesObserver
, void(IssuesObserver
* observer
));
57 MOCK_METHOD1(UnregisterIssuesObserver
, void(IssuesObserver
* observer
));
58 MOCK_METHOD1(RegisterMediaSinksObserver
, void(MediaSinksObserver
* observer
));
59 MOCK_METHOD1(UnregisterMediaSinksObserver
,
60 void(MediaSinksObserver
* observer
));
61 MOCK_METHOD1(RegisterMediaRoutesObserver
,
62 void(MediaRoutesObserver
* observer
));
63 MOCK_METHOD1(UnregisterMediaRoutesObserver
,
64 void(MediaRoutesObserver
* observer
));
65 MOCK_METHOD1(RegisterPresentationSessionMessagesObserver
,
66 void(PresentationSessionMessagesObserver
* observer
));
67 MOCK_METHOD1(UnregisterPresentationSessionMessagesObserver
,
68 void(PresentationSessionMessagesObserver
* observer
));
71 } // namespace media_router
73 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOCK_MEDIA_ROUTER_H_