#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 = …;
enum NoteUpdateType { … };
struct NoteConfig { … };
struct FrameConfig { … };
struct UserNoteDiffTestCase { … };
struct FrameConfigHash { … };
static std::string DescribeParams(
const testing::TestParamInfo<UserNoteDiffTestCase>& info) { … }
NoteIdList CopyAndSort(NoteIdList test_ids) { … }
NoteIdList ConvertToSortedTestIds(
const std::vector<base::UnguessableToken>& token_ids,
const std::unordered_map<base::UnguessableToken,
int,
base::UnguessableTokenHash>& token_to_test_id) { … }
}
class UserNoteUtilsTest
: public content::RenderViewHostTestHarness,
public testing::WithParamInterface<UserNoteDiffTestCase> { … };
std::vector<UserNoteDiffTestCase> BuildTestCases() { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(UserNoteUtilsTest, CalculateNoteChanges) { … }
}