fake_ota_activator.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 ASH_SERVICES_CELLULAR_SETUP_FAKE_OTA_ACTIVATOR_H_
  5. #define ASH_SERVICES_CELLULAR_SETUP_FAKE_OTA_ACTIVATOR_H_
  6. #include "ash/services/cellular_setup/ota_activator.h"
  7. #include "ash/services/cellular_setup/public/cpp/fake_carrier_portal_handler.h"
  8. #include "base/callback_forward.h"
  9. namespace ash::cellular_setup {
  10. // Test OtaActivator implementation.
  11. class FakeOtaActivator : public OtaActivator {
  12. public:
  13. explicit FakeOtaActivator(base::OnceClosure on_finished_callback);
  14. FakeOtaActivator(const FakeOtaActivator&) = delete;
  15. FakeOtaActivator& operator=(const FakeOtaActivator&) = delete;
  16. ~FakeOtaActivator() override;
  17. using OtaActivator::InvokeOnFinishedCallback;
  18. const std::vector<mojom::CarrierPortalStatus>& status_updates() const {
  19. return fake_carrier_portal_handler_.status_updates();
  20. }
  21. private:
  22. // mojom::CarrierPortalHandler:
  23. void OnCarrierPortalStatusChange(mojom::CarrierPortalStatus status) override;
  24. FakeCarrierPortalHandler fake_carrier_portal_handler_;
  25. };
  26. } // namespace ash::cellular_setup
  27. #endif // ASH_SERVICES_CELLULAR_SETUP_FAKE_OTA_ACTIVATOR_H_