fake_resource.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_
  11. #define CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_
  12. #include <string>
  13. #include <vector>
  14. #include "absl/types/optional.h"
  15. #include "api/adaptation/resource.h"
  16. #include "api/scoped_refptr.h"
  17. namespace webrtc {
  18. // Fake resource used for testing.
  19. class FakeResource : public Resource {
  20. public:
  21. static rtc::scoped_refptr<FakeResource> Create(std::string name);
  22. explicit FakeResource(std::string name);
  23. ~FakeResource() override;
  24. void SetUsageState(ResourceUsageState usage_state);
  25. // Resource implementation.
  26. std::string Name() const override;
  27. void SetResourceListener(ResourceListener* listener) override;
  28. private:
  29. const std::string name_;
  30. ResourceListener* listener_;
  31. };
  32. } // namespace webrtc
  33. #endif // CALL_ADAPTATION_TEST_FAKE_RESOURCE_H_