blob: 0310a4118d5ba7f582b6efbd6e6d8925e8520aac [file] [log] [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_ANDROID_AUTOFILL_BROWSER_ANDROID_AUTOFILL_PROVIDER_TEST_API_H_
#define COMPONENTS_ANDROID_AUTOFILL_BROWSER_ANDROID_AUTOFILL_PROVIDER_TEST_API_H_
#include "components/android_autofill/browser/android_autofill_provider.h"
namespace autofill {
class AndroidAutofillProviderTestApi {
public:
explicit AndroidAutofillProviderTestApi(AndroidAutofillProvider* provider)
: provider_(*provider) {}
const FormDataAndroid* form() && { return provider_->form_.get(); }
const FieldGlobalId last_focused_field_id() && {
return provider_->last_focused_field_id_;
}
private:
const raw_ref<AndroidAutofillProvider> provider_;
};
inline AndroidAutofillProviderTestApi test_api(
AndroidAutofillProvider& provider) {
return AndroidAutofillProviderTestApi(&provider);
}
} // namespace autofill
#endif // COMPONENTS_ANDROID_AUTOFILL_BROWSER_ANDROID_AUTOFILL_PROVIDER_TEST_API_H_