testing_api_binder.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2019 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. #ifndef SERVICES_AUDIO_TESTING_API_BINDER_H_
  5. #define SERVICES_AUDIO_TESTING_API_BINDER_H_
  6. #include "base/callback.h"
  7. #include "base/component_export.h"
  8. #include "services/audio/public/mojom/system_info.mojom.h"
  9. #include "services/audio/public/mojom/testing_api.mojom.h"
  10. namespace audio {
  11. // Exposes access to global storage for a callback that can bind a TestingApi
  12. // receiver. Test environments can use this to inject an implementation of
  13. // TestingApi, and the service will use it if available.
  14. using TestingApiBinder =
  15. base::RepeatingCallback<void(mojo::PendingReceiver<mojom::TestingApi>)>;
  16. COMPONENT_EXPORT(AUDIO_SERVICE_TESTING_API_SUPPORT)
  17. TestingApiBinder& GetTestingApiBinder();
  18. using SystemInfoBinder =
  19. base::RepeatingCallback<void(mojo::PendingReceiver<mojom::SystemInfo>)>;
  20. COMPONENT_EXPORT(AUDIO_SERVICE_TESTING_API_SUPPORT)
  21. SystemInfoBinder& GetSystemInfoBinderForTesting();
  22. } // namespace audio
  23. #endif // SERVICES_AUDIO_TESTING_API_BINDER_H_