chromium/chrome/browser/webauthn/cablev2_devices_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 "chrome/browser/webauthn/cablev2_devices.h"

#include <memory>
#include <vector>

#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/sync/base/data_type.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync_device_info/device_info.h"
#include "content/public/test/browser_task_environment.h"
#include "device/fido/cable/cable_discovery_data.h"
#include "device/fido/cable/v2_constants.h"
#include "device/fido/cable/v2_handshake.h"
#include "device/fido/features.h"
#include "testing/gtest/include/gtest/gtest.h"

KnownDevices;
MergeDevices;
Pairing;

namespace {

enum class Channel {};

constexpr uint8_t kPubKey1 =;
constexpr uint8_t kPubKey2 =;
constexpr uint8_t kPubKey3 =;
constexpr uint8_t kPubKey4 =;
constexpr uint8_t kPubKey5 =;
constexpr uint8_t kPubKey6 =;
constexpr uint8_t kPubKey7 =;
constexpr uint8_t kPubKey8 =;

const base::Time kTime9 =;
const base::Time kTime10 =;
const base::Time kTime11 =;

std::unique_ptr<Pairing> SyncedDevice(const char* name,
                                      uint8_t public_key_id,
                                      Channel channel,
                                      base::Time update) {}

std::unique_ptr<Pairing> LinkedDevice(const char* name, uint8_t public_key_id) {}

TEST(CableV2DeviceMerging, SyncOverridesForSameDevice) {}

TEST(CableV2DeviceMerging, MostRecentSyncFirst) {}

TEST(CableV2DeviceMerging, SyncOrderedByChannel) {}

TEST(CableV2DeviceMerging, Alphabetical) {}

class CableV2DevicesProfileTest : public testing::Test {};

TEST_F(CableV2DevicesProfileTest, InitiallyEmpty) {}

std::unique_ptr<Pairing> PairingWithAllFields() {}

TEST_F(CableV2DevicesProfileTest, StoreAndFetch) {}

TEST_F(CableV2DevicesProfileTest, Delete) {}

TEST_F(CableV2DevicesProfileTest, NameFiltering) {}

TEST_F(CableV2DevicesProfileTest, NameCollision) {}

TEST_F(CableV2DevicesProfileTest, NameOverride) {}

TEST_F(CableV2DevicesProfileTest, Rename) {}

TEST_F(CableV2DevicesProfileTest, UpdateLinkSameName) {}

TEST_F(CableV2DevicesProfileTest, UpdateLinkCollidingName) {}

TEST_F(CableV2DevicesProfileTest, InvalidTunnelServerDomain) {}

TEST_F(CableV2DevicesProfileTest, MissingTunnelServerDomain) {}

struct TestDeviceInfoConfig {};

syncer::DeviceInfo TestDeviceInfo(const TestDeviceInfoConfig& config) {}

TEST(CableV2FromSyncInfoTest, Basic) {}

TEST(CableV2FromSyncInfoTest, TooOld) {}

TEST(CableV2FromSyncInfoTest, NoInfo) {}

TEST(CableV2FromSyncInfoTest, UnknownTunnelServer) {}

}  // namespace