blob: caeaab01e7375149ca8565baaa20b56e48273374 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2020 The Chromium Authors
Yann Dagode0c6d12020-05-28 16:41:542// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/downgrade/snapshot_manager.h"
6
7#include "base/containers/flat_set.h"
8#include "chrome/browser/downgrade/snapshot_file_collector.h"
9#include "testing/gtest/include/gtest/gtest.h"
10
11namespace downgrade {
12
13// Tests that ids are not duplicated across the lists of snapshot items.
14TEST(SnapshotFileCollector, SnapshotFileIds) {
15 auto profile_items = CollectProfileItems();
16 auto user_data_items = CollectUserDataItems();
17 base::flat_set<SnapshotItemId> ids;
18 for (const auto& item : profile_items)
19 EXPECT_TRUE(ids.insert(item.id).second) << static_cast<int>(item.id);
20 for (const auto& item : user_data_items)
21 EXPECT_TRUE(ids.insert(item.id).second) << static_cast<int>(item.id);
22}
23
24} // namespace downgrade