chromium/components/os_crypt/sync/kwallet_dbus_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/os_crypt/sync/kwallet_dbus.h"

#include <memory>
#include <string>

#include "base/nix/xdg_util.h"
#include "dbus/message.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_object_proxy.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

_;
AllOf;
ByMove;
DoAll;
ElementsAreArray;
Invoke;
Return;
StrictMock;

const char kKWalletInterface[] =;
const char kKLauncherInterface[] =;

std::unique_ptr<dbus::Response> RespondBool(bool value) {}

std::unique_ptr<dbus::Response> RespondString(const std::string& value) {}

std::unique_ptr<dbus::Response> RespondBytes(
    const std::vector<uint8_t>& bytes) {}

std::unique_ptr<dbus::Response> RespondArrayOfStrings(
    const std::vector<std::string>& strings) {}

std::unique_ptr<dbus::Response> RespondInt32(int value) {}

class KWalletDBusTest
    : public testing::TestWithParam<base::nix::DesktopEnvironment> {};

INSTANTIATE_TEST_SUITE_P();

// Matches a method call to the specified dbus target.
MATCHER_P2(Calls, interface, member, "") {}

// Pops items from the dbus message and compares them to the expected values.
MATCHER_P3(ArgumentsAreIntStringString, int_1, str_2, str_3, "") {}

// Pops items from the dbus message and compares them to the expected values.
MATCHER_P4(ArgumentsAreIntStringStringString, int_1, str_2, str_3, str_4, "") {}

// Pops items from the dbus message and compares them to the expected values.
MATCHER_P5(ArgumentsAreIntStringStringBytesString,
           int_1,
           str_2,
           str_3,
           vec_4,
           str_5,
           "") {}

// Pops items from the dbus message and compares them to the expected values.
MATCHER_P3(ArgumentsAreStringInt64String, str_1, int_2, str_3, "") {}

// Pops items from the dbus message and compares them to the expected values.
MATCHER_P5(ArgumentsAreStringStringsStringsStringBool,
           str_1,
           vec_2,
           vec_3,
           str_4,
           bool_5,
           "") {}

MATCHER_P5(ArgumentsAreIntStringStringStringString,
           int_1,
           str_2,
           str_3,
           str_4,
           str_5,
           "") {}

MATCHER_P3(ArgumentsAreIntBoolString, int_1, bool_2, str_3, "") {}

TEST_P(KWalletDBusTest, StartWalletd) {}

TEST_P(KWalletDBusTest, StartWalletdErrorRead) {}

TEST_P(KWalletDBusTest, StartWalletdErrorContact) {}

TEST_P(KWalletDBusTest, IsEnabledTrue) {}

TEST_P(KWalletDBusTest, IsEnabledFalse) {}

TEST_P(KWalletDBusTest, IsEnabledErrorRead) {}

TEST_P(KWalletDBusTest, IsEnabledErrorContact) {}

TEST_P(KWalletDBusTest, NetworkWallet) {}

TEST_P(KWalletDBusTest, NetworkWalletErrorRead) {}

TEST_P(KWalletDBusTest, NetworkWalletErrorContact) {}

TEST_P(KWalletDBusTest, Open) {}

TEST_P(KWalletDBusTest, OpenErrorRead) {}

TEST_P(KWalletDBusTest, OpenErrorContact) {}

TEST_P(KWalletDBusTest, HasEntry) {}

TEST_P(KWalletDBusTest, HasEntryErrorRead) {}

TEST_P(KWalletDBusTest, HasEntryErrorContact) {}

TEST_P(KWalletDBusTest, EntryType) {}

TEST_P(KWalletDBusTest, EntryTypeErrorRead) {}

TEST_P(KWalletDBusTest, EntryTypeErrorContact) {}

TEST_P(KWalletDBusTest, ReadEntry) {}

TEST_P(KWalletDBusTest, ReadEntryErrorRead) {}

TEST_P(KWalletDBusTest, ReadEntryErrorContact) {}

TEST_P(KWalletDBusTest, EntryList) {}

TEST_P(KWalletDBusTest, EntryListErrorRead) {}

TEST_P(KWalletDBusTest, EntryListErrorContact) {}

TEST_P(KWalletDBusTest, RemoveEntry) {}

TEST_P(KWalletDBusTest, RemoveEntryErrorRead) {}

TEST_P(KWalletDBusTest, RemoveEntryErrorContact) {}

TEST_P(KWalletDBusTest, WriteEntry) {}

TEST_P(KWalletDBusTest, WriteEntryErrorRead) {}

TEST_P(KWalletDBusTest, WriteEntryErrorContact) {}

TEST_P(KWalletDBusTest, HasFolder) {}

TEST_P(KWalletDBusTest, HasFolderErrorRead) {}

TEST_P(KWalletDBusTest, HasFolderErrorContact) {}

TEST_P(KWalletDBusTest, CreateFolder) {}

TEST_P(KWalletDBusTest, CreateFolderErrorRead) {}

TEST_P(KWalletDBusTest, CreateFolderErrorContact) {}

TEST_P(KWalletDBusTest, WritePassword) {}

TEST_P(KWalletDBusTest, WritePasswordRejected) {}

TEST_P(KWalletDBusTest, WritePasswordErrorRead) {}

TEST_P(KWalletDBusTest, WritePasswordErrorContact) {}

TEST_P(KWalletDBusTest, ReadPassword) {}

TEST_P(KWalletDBusTest, ReadPasswordErrorRead) {}

TEST_P(KWalletDBusTest, ReadPasswordErrorContact) {}

TEST_P(KWalletDBusTest, CloseSuccess) {}

TEST_P(KWalletDBusTest, CloseUnsuccessful) {}

TEST_P(KWalletDBusTest, CloseErrorRead) {}

TEST_P(KWalletDBusTest, CloseErrorContact) {}

}  // namespace