1 // Copyright 2018 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. 4 5 #ifndef OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_ 6 #define OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_ 7 8 #include <vector> 9 10 #include "osp/impl/mdns_platform_service.h" 11 12 namespace openscreen { 13 namespace osp { 14 15 class FakeMdnsPlatformService final : public MdnsPlatformService { 16 public: 17 FakeMdnsPlatformService(); 18 ~FakeMdnsPlatformService() override; 19 set_interfaces(const std::vector<BoundInterface> & interfaces)20 void set_interfaces(const std::vector<BoundInterface>& interfaces) { 21 interfaces_ = interfaces; 22 } 23 24 // PlatformService overrides. 25 std::vector<BoundInterface> RegisterInterfaces( 26 const std::vector<NetworkInterfaceIndex>& interface_index_allowlist) 27 override; 28 void DeregisterInterfaces( 29 const std::vector<BoundInterface>& registered_interfaces) override; 30 31 private: 32 std::vector<BoundInterface> registered_interfaces_; 33 std::vector<BoundInterface> interfaces_; 34 }; 35 36 } // namespace osp 37 } // namespace openscreen 38 39 #endif // OSP_IMPL_TESTING_FAKE_MDNS_PLATFORM_SERVICE_H_ 40