mock_scan_utils.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_SCAN_UTILS_H_
  17. #define WIFICOND_TEST_MOCK_SCAN_UTILS_H_
  18. #include <gmock/gmock.h>
  19. #include "wificond/scanning/scan_utils.h"
  20. namespace android {
  21. namespace wificond {
  22. class MockScanUtils : public ScanUtils {
  23. public:
  24. MockScanUtils(NetlinkManager* netlink_manager);
  25. ~MockScanUtils() override = default;
  26. MOCK_METHOD1(UnsubscribeScanResultNotification,
  27. void(uint32_t interface_index));
  28. MOCK_METHOD1(AbortScan, bool(uint32_t interface_index));
  29. MOCK_METHOD1(StopScheduledScan, bool(uint32_t interface_index));
  30. MOCK_METHOD2(SubscribeScanResultNotification,void(
  31. uint32_t interface_index,
  32. OnScanResultsReadyHandler handler));
  33. MOCK_METHOD2(GetScanResult, bool(
  34. uint32_t interface_index,
  35. std::vector<::com::android::server::wifi::wificond::NativeScanResult>* out_scan_results));
  36. MOCK_METHOD6(Scan, bool(
  37. uint32_t interface_index,
  38. bool request_random_mac,
  39. int scan_type,
  40. const std::vector<std::vector<uint8_t>>& ssids,
  41. const std::vector<uint32_t>& freqs,
  42. int* error_code));
  43. MOCK_METHOD9(StartScheduledScan, bool(
  44. uint32_t interface_index,
  45. const SchedScanIntervalSetting& interval_setting,
  46. int32_t rssi_threshold_2g,
  47. int32_t rssi_threshold_5g,
  48. const SchedScanReqFlags& req_flags,
  49. const std::vector<std::vector<uint8_t>>& scan_ssids,
  50. const std::vector<std::vector<uint8_t>>& match_ssids,
  51. const std::vector<uint32_t>& freqs,
  52. int* error_code));
  53. }; // class MockScanUtils
  54. } // namespace wificond
  55. } // namespace android
  56. #endif // WIFICOND_TEST_MOCK_SCAN_UTILS_H