1 /* 2 * Copyright 2019 The WebRTC Project Authors. All rights reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_ 12 #define CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_ 13 14 #include <string> 15 #include <vector> 16 17 #include "absl/types/optional.h" 18 #include "api/adaptation/resource.h" 19 #include "api/scoped_refptr.h" 20 21 namespace webrtc { 22 23 // Fake resource used for testing. 24 class FakeResource : public Resource { 25 public: 26 static rtc::scoped_refptr<FakeResource> Create(std::string name); 27 28 explicit FakeResource(std::string name); 29 ~FakeResource() override; 30 31 void SetUsageState(ResourceUsageState usage_state); 32 33 // Resource implementation. 34 std::string Name() const override; 35 void SetResourceListener(ResourceListener* listener) override; 36 37 private: 38 const std::string name_; 39 ResourceListener* listener_; 40 }; 41 42 } // namespace webrtc 43 44 #endif // CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_ 45