chromium/components/user_notes/browser/user_note_utils_unittest.cc

// Copyright 2022 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/user_notes/browser/user_note_utils.h"

#include <algorithm>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "components/user_notes/browser/frame_user_note_changes.h"
#include "components/user_notes/browser/user_note_manager.h"
#include "components/user_notes/interfaces/user_note_metadata_snapshot.h"
#include "components/user_notes/model/user_note_model_test_utils.h"
#include "components/user_notes/user_notes_features.h"
#include "content/public/browser/page.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace user_notes {

namespace {

NoteIdList;

const char kUrl1[] =;
const char kUrl2[] =;
const char kUrl3[] =;
const char kUrl4[] =;
const char kUrl5[] =;

const base::Time kInitialTimeStamp =;
const base::Time kUpdatedTimeStamp =;

// An enum describing the different types of update that can happen to a note
// during a test case. This determines what kind of updated metadata will be
// generated during the test.
enum NoteUpdateType {};

// Configuration for simulating a note in a test case.
struct NoteConfig {};

// Configuration for initializing one `RenderFrameHost` during a test case and
// setting its diff expectations.
struct FrameConfig {};

// A test case for the diff calculation tests.
struct UserNoteDiffTestCase {};

// Hasher for using frame configs as keys in an unordered map.
struct FrameConfigHash {};

// Helper for setting the test case's name.
static std::string DescribeParams(
    const testing::TestParamInfo<UserNoteDiffTestCase>& info) {}

// Helper to copy a vector of test IDs and sort them.
NoteIdList CopyAndSort(NoteIdList test_ids) {}

// Helper method to convert note token IDs to their equivalent test IDs as
// configured in the provided map.
NoteIdList ConvertToSortedTestIds(
    const std::vector<base::UnguessableToken>& token_ids,
    const std::unordered_map<base::UnguessableToken,
                             int,
                             base::UnguessableTokenHash>& token_to_test_id) {}

}  // namespace

class UserNoteUtilsTest
    : public content::RenderViewHostTestHarness,
      public testing::WithParamInterface<UserNoteDiffTestCase> {};

std::vector<UserNoteDiffTestCase> BuildTestCases() {}

INSTANTIATE_TEST_SUITE_P();

TEST_P(UserNoteUtilsTest, CalculateNoteChanges) {}

}  // namespace user_notes