AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MockExternalMediaAdapterHandler.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef AVS_CAPABILITIES_EXTERNALMEDIAPLAYER_ACSDKEXTERNALMEDIAPLAYER_TEST_ACSDKEXTERNALMEDIAPLAYER_MOCKEXTERNALMEDIAADAPTERHANDLER_H_
17 #define AVS_CAPABILITIES_EXTERNALMEDIAPLAYER_ACSDKEXTERNALMEDIAPLAYER_TEST_ACSDKEXTERNALMEDIAPLAYER_MOCKEXTERNALMEDIAADAPTERHANDLER_H_
18 
19 #include <gtest/gtest.h>
20 
21 namespace alexaClientSDK {
22 namespace acsdkExternalMediaPlayer {
23 namespace test {
24 
25 static const std::string PLAYER_ID = "testPlayerId";
26 
29 public:
30  MOCK_METHOD1(handleAuthorization, bool(const AuthorizedPlayerInfo& authorizedPlayer));
33  bool(
34  const std::string& localPlayerId,
35  const std::string& accessToken,
36  const std::string& userName,
37  bool forceLogin,
38  std::chrono::milliseconds tokenRefreshInterval));
39  MOCK_METHOD1(handleLogout, bool(const std::string& localPlayerId));
40  MOCK_METHOD1(handlePlay, bool(const PlayParams& params));
43  bool(
44  const std::string& localPlayerId,
46  const std::string& playbackTarget));
47  MOCK_METHOD2(handleSeek, bool(const std::string& localPlayerId, std::chrono::milliseconds offset));
48  MOCK_METHOD2(handleAdjustSeek, bool(const std::string& localPlayerId, std::chrono::milliseconds deltaOffset));
51  bool(const std::string& localPlayerId, acsdkExternalMediaPlayerInterfaces::AdapterState& state));
52  MOCK_METHOD1(handleSetVolume, void(int8_t volume));
53  MOCK_METHOD1(handleSetMute, void(bool mute));
54  void reportMockPlayers(const std::string& localPlayerId);
56 };
57 
60 
61  playerInfo.localPlayerId = localPlayerId;
62  reportDiscoveredPlayers({playerInfo});
63 };
64 
66 }
67 
68 } // namespace test
69 } // namespace acsdkExternalMediaPlayer
70 } // namespace alexaClientSDK
71 
72 #endif // AVS_CAPABILITIES_EXTERNALMEDIAPLAYER_ACSDKEXTERNALMEDIAPLAYER_TEST_ACSDKEXTERNALMEDIAPLAYER_MOCKEXTERNALMEDIAADAPTERHANDLER_H_
virtual bool handlePlay(const ExternalMediaAdapterHandlerInterface::PlayParams &params)=0
MOCK_METHOD3(handlePlayControl, bool(const std::string &localPlayerId, acsdkExternalMediaPlayerInterfaces::RequestType requestType, const std::string &playbackTarget))
static const std::string PLAYER_ID
Definition: MockExternalMediaAdapterHandler.h:25
Definition: AmdMetricWrapperTest.cpp:24
RequestType
Definition: ExternalMediaAdapterInterface.h:32
::std::string string
Definition: gtest-port.h:1097
virtual bool handleLogin(const std::string &localPlayerId, const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval)=0
Definition: ExternalMediaAdapterHandler.h:42
Definition: ExternalMediaAdapterInterface.h:495
PlayParams is a struct that contains the parameters for the play method.
Definition: ExternalMediaAdapterHandlerInterface.h:61
virtual bool handleAuthorization(const AuthorizedPlayerInfo &authorizedPlayer)=0
virtual bool handleGetAdapterState(const std::string &localPlayerId, acsdkExternalMediaPlayerInterfaces::AdapterState &state)=0
std::string localPlayerId
The opaque token that uniquely identifies the local external player app.
Definition: ExternalMediaPlayerCommon.h:50
virtual bool handlePlayControl(const std::string &localPlayerId, acsdkExternalMediaPlayerInterfaces::RequestType requestType, const std::string &playbackTarget)=0
virtual bool handleLogout(const std::string &localPlayerId)=0
virtual bool handleSeek(const std::string &localPlayerId, std::chrono::milliseconds offset)=0
MOCK_METHOD1(handleAuthorization, bool(const AuthorizedPlayerInfo &authorizedPlayer))
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void reportMockPlayers(const std::string &localPlayerId)
Definition: MockExternalMediaAdapterHandler.h:58
MOCK_METHOD2(handleSeek, bool(const std::string &localPlayerId, std::chrono::milliseconds offset))
Mock class for ExternalMediaPlayerAdapterHandler.
Definition: MockExternalMediaAdapterHandler.h:28
MockExternalMediaAdapterHandler()
Definition: MockExternalMediaAdapterHandler.h:65
MOCK_METHOD5(handleLogin, bool(const std::string &localPlayerId, const std::string &accessToken, const std::string &userName, bool forceLogin, std::chrono::milliseconds tokenRefreshInterval))
virtual bool handleAdjustSeek(const std::string &localPlayerId, std::chrono::milliseconds deltaOffset)=0
void reportDiscoveredPlayers(const std::vector< acsdkExternalMediaPlayerInterfaces::DiscoveredPlayerInfo > &discoveredPlayers)

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0