chromium/components/autofill/core/browser/autofill_ablation_study_unittest.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/autofill/core/browser/autofill_ablation_study.h"

#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_optimization_guide.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/optimization_guide/core/test_optimization_guide_decider.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
#include "url/gurl.h"

kAutofillAblationStudyAblationWeightPerMilleList1Param;
kAutofillAblationStudyAblationWeightPerMilleList2Param;
kAutofillAblationStudyAblationWeightPerMilleList3Param;
kAutofillAblationStudyAblationWeightPerMilleList4Param;
kAutofillAblationStudyAblationWeightPerMilleParam;
kAutofillAblationStudyEnabledForAddressesParam;
kAutofillAblationStudyEnabledForPaymentsParam;
kAutofillEnableAblationStudy;

namespace autofill {

namespace {

// Calls GetAblationGroup |n| times on different security origins and returns a
// histogram of the number of times certain AblationGroups were returned.
std::map<AblationGroup, int> RunNIterations(
    const AutofillAblationStudy& study,
    int n,
    FormTypeForAblationStudy form_type,
    AutofillOptimizationGuide* autofill_optimization_guide) {}

}  // namespace

class AutofillAblationStudyTest : public testing::Test {};

// Tests in UTC timezone.
class AutofillAblationStudyTestInUTC : public AutofillAblationStudyTest {};

TEST_F(AutofillAblationStudyTestInUTC, DaysSinceLocalWindowsEpoch) {}

// Tests in EST timezone.
class AutofillAblationStudyTestInEST : public AutofillAblationStudyTest {};

TEST_F(AutofillAblationStudyTestInEST, DaysSinceLocalWindowsEpoch) {}

TEST_F(AutofillAblationStudyTestInEST, DayInAblationWindow) {}

TEST_F(AutofillAblationStudyTestInUTC, GetAblationHash_IdenticalInput) {}

TEST_F(AutofillAblationStudyTestInUTC, GetAblationHash_DependsOnSeed) {}

TEST_F(AutofillAblationStudyTestInUTC, GetAblationHash_DependsOnOrigin) {}

TEST_F(AutofillAblationStudyTestInUTC, GetAblationHash_DependsOnDay) {}

// Ensure that if the feature is disabled, only kDefault is returned.
TEST_F(AutofillAblationStudyTestInUTC, FeatureDisabled) {}

// Ensure that if the weight is invalid, only kDefault is returned.
TEST_F(AutofillAblationStudyTestInUTC, InvalidParameters) {}

// Ensure that if the feature is enabled but the individual form types are
// disabled, only kDefault is returned.
TEST_F(AutofillAblationStudyTestInUTC, FormTypesDisabled) {}

// Perform some plausibility check if the feature is fully enabled.
TEST_F(AutofillAblationStudyTestInUTC, IntegrationTest) {}

// Verify that an empty seed always gives kDefault.
TEST_F(AutofillAblationStudyTestInUTC, IntegrationTestForEmptySeed) {}

// Perform some plausibility check if the feature is fully enabled and uses
// optimization guides that define the ablationrates for different sets of
// domains.
TEST_F(AutofillAblationStudyTestInUTC, IntegrationTestForOptimizationGuide) {}

}  // namespace autofill