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 16 #include "call/adaptation/resource.h" 17 18 namespace webrtc { 19 20 // Fake resource used for testing. 21 class FakeResource : public Resource { 22 public: 23 explicit FakeResource(ResourceUsageState usage_state); 24 FakeResource(ResourceUsageState usage_state, const std::string& name); 25 ~FakeResource() override; 26 27 void set_usage_state(ResourceUsageState usage_state); 28 last_response()29 absl::optional<ResourceListenerResponse> last_response() const { 30 return last_response_; 31 } 32 name()33 std::string name() const override { return name_; } 34 35 private: 36 absl::optional<ResourceListenerResponse> last_response_; 37 const std::string name_; 38 }; 39 40 } // namespace webrtc 41 42 #endif // CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_ 43