#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_UTILS_VOTE_UPLOADS_TEST_MATCHERS_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_UTILS_VOTE_UPLOADS_TEST_MATCHERS_H_
#include <initializer_list>
#include <string>
#include "components/autofill/core/browser/proto/server.pb.h"
#include "components/autofill/core/common/signatures.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
inline auto FirstElementIs(auto matcher) {
return ::testing::AllOf(
::testing::SizeIs(::testing::Gt(0u)),
ResultOf([](const auto& container) { return container[0]; }, matcher));
}
namespace upload_contents_matchers {
inline ::testing::Matcher<AutofillUploadContents> AutofillUsedIs(
bool autofill_used) { … }
inline ::testing::Matcher<AutofillUploadContents> FormSignatureIs(
FormSignature form_signature) { … }
template <typename... Matchers>
inline ::testing::Matcher<AutofillUploadContents> FieldsAre(
Matchers... matchers) { … }
template <typename... Matchers>
requires(sizeof...(Matchers) > 0)
inline ::testing::Matcher<AutofillUploadContents> FieldsContain(
Matchers... matchers) { … }
inline ::testing::Matcher<AutofillUploadContents> ObservedSubmissionIs(
bool observed_submission) { … }
inline ::testing::Matcher<AutofillUploadContents> SubmissionIndicatorEventIs(
mojom::SubmissionIndicatorEvent event) { … }
inline ::testing::Matcher<AutofillUploadContents::Field> FieldAutofillTypeIs(
FieldTypeSet type_set) { … }
inline ::testing::Matcher<AutofillUploadContents::Field> FieldSignatureIs(
FieldSignature signature) { … }
inline ::testing::Matcher<AutofillUploadContents> PasswordLengthIsPositive() { … }
inline ::testing::Matcher<AutofillUploadContents> HasPasswordAttribute() { … }
}
}
#endif