mock_offload.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2016 The Android Open Source Project
  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. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef WIFICOND_TEST_MOCK_OFFLOAD_H
  17. #define WIFICOND_TEST_MOCK_OFFLOAD_H
  18. #include <gmock/gmock.h>
  19. #include <android/hardware/wifi/offload/1.0/IOffload.h>
  20. namespace android {
  21. namespace wificond {
  22. typedef std::function<void(
  23. const android::hardware::wifi::offload::V1_0::OffloadStatus& status,
  24. const android::hardware::wifi::offload::V1_0::ScanStats& scanStats)>
  25. OnScanStatsCallback;
  26. typedef std::function<void(
  27. const android::hardware::wifi::offload::V1_0::OffloadStatus& status)>
  28. StatusCallback;
  29. class MockOffload : public android::hardware::wifi::offload::V1_0::IOffload {
  30. public:
  31. MockOffload();
  32. ~MockOffload() override = default;
  33. MOCK_METHOD3(
  34. configureScans,
  35. android::hardware::Return<void>(
  36. const android::hardware::wifi::offload::V1_0::ScanParam& param,
  37. const android::hardware::wifi::offload::V1_0::ScanFilter& filter,
  38. StatusCallback _hidl_cb));
  39. MOCK_METHOD1(getScanStats,
  40. android::hardware::Return<void>(OnScanStatsCallback cb));
  41. MOCK_METHOD2(subscribeScanResults,
  42. android::hardware::Return<void>(uint32_t delayMs,
  43. StatusCallback _hidl_cb));
  44. MOCK_METHOD0(unsubscribeScanResults, android::hardware::Return<void>());
  45. MOCK_METHOD1(
  46. setEventCallback,
  47. android::hardware::Return<void>(
  48. const android::sp<
  49. android::hardware::wifi::offload::V1_0::IOffloadCallback>& cb));
  50. };
  51. } // namespace wificond
  52. } // namespace android
  53. #endif // WIFICOND_TEST_MOCK_OFFLOAD_H