1 // Copyright 2016 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 16 #ifndef BRILLO_AUDIO_AUDIOSERVICE_BRILLO_AUDIO_SERVICE_MOCK_H_ 17 #define BRILLO_AUDIO_AUDIOSERVICE_BRILLO_AUDIO_SERVICE_MOCK_H_ 18 19 #include <vector> 20 21 #include <gmock/gmock.h> 22 #include <gtest/gtest_prod.h> 23 24 #include "brillo_audio_service.h" 25 26 namespace brillo { 27 28 class BrilloAudioServiceMock : public BrilloAudioService { 29 public: 30 BrilloAudioServiceMock() = default; ~BrilloAudioServiceMock()31 ~BrilloAudioServiceMock() {} 32 33 MOCK_METHOD2(GetDevices, Status(int flag, std::vector<int>* _aidl_return)); 34 MOCK_METHOD2(SetDevice, Status(int usage, int config)); 35 MOCK_METHOD2(GetMaxVolumeSteps, Status(int stream, int* _aidl_return)); 36 MOCK_METHOD2(SetMaxVolumeSteps, Status(int stream, int max_steps)); 37 MOCK_METHOD3(SetVolumeIndex, Status(int stream, int device, int index)); 38 MOCK_METHOD3(GetVolumeIndex, 39 Status(int stream, int device, int* _aidl_return)); 40 MOCK_METHOD1(GetVolumeControlStream, Status(int* _aidl_return)); 41 MOCK_METHOD1(SetVolumeControlStream, Status(int stream)); 42 MOCK_METHOD0(IncrementVolume, Status()); 43 MOCK_METHOD0(DecrementVolume, Status()); 44 MOCK_METHOD1(RegisterServiceCallback, 45 Status(const android::sp<IAudioServiceCallback>& callback)); 46 MOCK_METHOD1(UnregisterServiceCallback, 47 Status(const android::sp<IAudioServiceCallback>& callback)); 48 RegisterHandlers(std::weak_ptr<AudioDeviceHandler>,std::weak_ptr<AudioVolumeHandler>)49 void RegisterHandlers(std::weak_ptr<AudioDeviceHandler>, 50 std::weak_ptr<AudioVolumeHandler>){}; OnDevicesConnected(const std::vector<int> &)51 void OnDevicesConnected(const std::vector<int>&) {} OnDevicesDisconnected(const std::vector<int> &)52 void OnDevicesDisconnected(const std::vector<int>&) {} OnVolumeChanged(audio_stream_type_t,int,int)53 void OnVolumeChanged(audio_stream_type_t, int, int){}; 54 }; 55 56 } // namespace brillo 57 58 #endif // BRILLO_AUDIO_AUDIOSERVICE_BRILLO_AUDIO_SERVICE_MOCK_H_ 59