#include <string>
#include <unordered_map>
#include "base/lazy_instance.h"
#include "components/os_crypt/sync/key_storage_libsecret.h"
#include "components/os_crypt/sync/libsecret_util_linux.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/glib/scoped_gobject.h"
namespace {
const SecretSchema kKeystoreSchemaV2 = …;
class MockPasswordStore { … };
base::LazyInstance<MockPasswordStore>::Leaky g_password_store = …;
class MockLibsecretLoader : public LibsecretLoader { … };
const gchar* MockLibsecretLoader::mock_secret_value_get_text(
SecretValue* value) { … }
gboolean MockLibsecretLoader::mock_secret_password_store_sync(
const SecretSchema* schema,
const gchar* collection,
const gchar* label,
const gchar* password,
GCancellable* cancellable,
GError** error,
...) { … }
void MockLibsecretLoader::mock_secret_value_unref(gpointer value) { … }
GList* MockLibsecretLoader::mock_secret_service_search_sync(
SecretService* service,
const SecretSchema* schema,
GHashTable* attributes,
SecretSearchFlags flags,
GCancellable* cancellable,
GError** error) { … }
SecretValue* MockLibsecretLoader::mock_secret_item_get_secret(
SecretItem* item) { … }
guint64 MockLibsecretLoader::mock_secret_item_get_created(SecretItem* item) { … }
guint64 MockLibsecretLoader::mock_secret_item_get_modified(SecretItem* item) { … }
bool MockLibsecretLoader::ResetForOSCrypt() { … }
void MockLibsecretLoader::TearDown() { … }
class LibsecretTest : public testing::Test { … };
TEST_F(LibsecretTest, LibsecretRepeats) { … }
TEST_F(LibsecretTest, LibsecretCreatesRandomised) { … }
}