chromium/components/autofill/core/browser/webdata/autocomplete/autocomplete_table_unittest.cc

// 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.

#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_table.h"

#include <string>
#include <utility>

#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_entry.h"
#include "components/autofill/core/browser/webdata/autofill_change.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/webdata/common/web_database.h"
#include "sql/statement.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace autofill {

namespace {

AutocompleteEntrySet;
Time;
ElementsAre;

bool CompareAutocompleteEntries(const AutocompleteEntry& a,
                                const AutocompleteEntry& b) {}

AutocompleteEntry MakeAutocompleteEntry(const std::u16string& name,
                                        const std::u16string& value,
                                        time_t date_created,
                                        time_t date_last_used) {}

// Checks |actual| and |expected| contain the same elements.
void CompareAutocompleteEntrySets(const AutocompleteEntrySet& actual,
                                  const AutocompleteEntrySet& expected) {}

int GetAutocompleteEntryCount(const std::u16string& name,
                              const std::u16string& value,
                              WebDatabase* db) {}

class AutocompleteTableTest : public testing::Test {};

TEST_F(AutocompleteTableTest, Autocomplete) {}

TEST_F(AutocompleteTableTest, Autocomplete_GetEntry_Populated) {}

TEST_F(AutocompleteTableTest, Autocomplete_GetCountOfValuesContainedBetween) {}

TEST_F(AutocompleteTableTest, Autocomplete_RemoveBetweenChanges) {}

TEST_F(AutocompleteTableTest, Autocomplete_AddChanges) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateOneWithOneTimestamp) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateOneWithTwoTimestamps) {}

TEST_F(AutocompleteTableTest, Autocomplete_GetAutofillTimestamps) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateTwo) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateNullTerminated) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateReplace) {}

TEST_F(AutocompleteTableTest, Autocomplete_UpdateDontReplace) {}

TEST_F(AutocompleteTableTest, Autocomplete_AddFormFieldValues) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_UsedOnlyBefore) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_UsedOnlyAfter) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_UsedOnlyDuring) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_UsedBeforeAndDuring) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_UsedDuringAndAfter) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_RemoveFormElementsAddedBetween_OlderThan30Days) {}

// Tests that we set the change type to EXPIRE for expired elements and we
// delete an old entry.
TEST_F(AutocompleteTableTest, RemoveExpiredFormElements_Expires_DeleteEntry) {}

// Tests that we don't
// delete non-expired entries' data from the SQLite table.
TEST_F(AutocompleteTableTest, RemoveExpiredFormElements_NotOldEnough) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_GetAllAutocompleteEntries_NoResults) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_GetAllAutocompleteEntries_OneResult) {}

TEST_F(AutocompleteTableTest,
       Autocomplete_GetAllAutocompleteEntries_TwoDistinct) {}

TEST_F(AutocompleteTableTest, Autocomplete_GetAllAutocompleteEntries_TwoSame) {}

TEST_F(AutocompleteTableTest, DontCrashWhenAddingValueToPoisonedDB) {}

}  // namespace

}  // namespace autofill