chromium/components/translate/core/browser/translate_prefs_unittest.cc

// Copyright 2014 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/translate/core/browser/translate_prefs.h"

#include <algorithm>
#include <limits>
#include <string>
#include <utility>
#include <vector>

#include "base/json/json_reader.h"
#include "base/json/values_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/language/core/browser/language_prefs.h"
#include "components/language/core/browser/language_prefs_test_util.h"
#include "components/language/core/browser/pref_names.h"
#include "components/language/core/common/language_experiments.h"
#include "components/prefs/mock_pref_change_callback.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/translate/core/browser/translate_download_manager.h"
#include "components/translate/core/browser/translate_pref_names.h"
#include "components/translate/core/common/translate_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_collator.h"

namespace translate {

namespace {

ElementsAre;
ElementsAreArray;
IsEmpty;
UnorderedElementsAreArray;

static void ExpectEqualLanguageLists(
    const base::Value::List& language_values,
    const std::vector<std::string>& languages) {}

}  // namespace

class TranslatePrefsTest : public testing::Test {};

// Test that GetLanguageInfoList() returns the correct list of languages based
// on the given locale.
TEST_F(TranslatePrefsTest, GetLanguageInfoListCorrectLocale) {}

// Check the output of GetLanguageInfoList().
TEST_F(TranslatePrefsTest, GetLanguageInfoListOutput) {}

TEST_F(TranslatePrefsTest, GetLanguageInfoList) {}

// Test that GetTranslatableContentLanguages() returns the correct list.
TEST_F(TranslatePrefsTest, GetTranslatableContentLanguagesCorrectLocale) {}

TEST_F(TranslatePrefsTest, BlockLanguage) {}

TEST_F(TranslatePrefsTest, UnblockLanguage) {}

TEST_F(TranslatePrefsTest, ResetEmptyBlockedLanguagesToDefaultTest) {}

TEST_F(TranslatePrefsTest, GetNeverTranslateLanguagesTest) {}

TEST_F(TranslatePrefsTest, AddToLanguageList) {}

TEST_F(TranslatePrefsTest, RemoveFromLanguageList) {}

TEST_F(TranslatePrefsTest, RemoveFromLanguageListRemovesRemainingUnsupported) {}

TEST_F(TranslatePrefsTest, RemoveFromLanguageListClearsRecentLanguage) {}

TEST_F(TranslatePrefsTest, MoveLanguageToTheTop) {}

TEST_F(TranslatePrefsTest, MoveLanguageUp) {}

TEST_F(TranslatePrefsTest, MoveLanguageDown) {}

TEST_F(TranslatePrefsTest, MigrateNeverPromptSites) {}

// Regression test for https://crbug.com/1295549
TEST_F(TranslatePrefsTest, InvalidNeverPromptSites) {}

TEST_F(TranslatePrefsTest, MigrateInvalidNeverPromptSites) {}

TEST_F(TranslatePrefsTest, ShouldNotifyUponMigrateNeverPromptSites) {}

TEST_F(TranslatePrefsTest,
       ShouldNotifyUponMigrateNeverPromptSitesForNonEmptyInitialValue) {}

TEST_F(TranslatePrefsTest, ShouldNotNotifyUponMigrateInvalidNeverPromptSites) {}

TEST_F(TranslatePrefsTest, ShouldNotNotifyUponMigrateNoNeverPromptSites) {}

TEST_F(TranslatePrefsTest, SiteNeverPromptList) {}

TEST_F(TranslatePrefsTest, DefaultBlockedLanguages) {}

TEST_F(TranslatePrefsTest, SetRecentTargetLanguage) {}

// Series of tests for the AlwaysTranslateLanguagesList manipulation functions.
TEST_F(TranslatePrefsTest, AlwaysTranslateLanguages) {}

// Test that a language can not be on both the never and always translate list.
TEST_F(TranslatePrefsTest, NeverOnAlwaysAndNever) {}

TEST_F(TranslatePrefsTest, CanTranslateLanguage) {}

TEST_F(TranslatePrefsTest, ForceTriggerOnEnglishPagesCount) {}

class TranslatePrefsMigrationTest : public testing::Test {};

TEST_F(TranslatePrefsMigrationTest,
       MigrateObsoleteAlwaysTranslateLanguagesPref_Disabled) {}

TEST_F(TranslatePrefsMigrationTest,
       MigrateObsoleteAlwaysTranslateLanguagesPref_Enabled) {}

}  // namespace translate