chromium/components/permissions/permission_auditing_service_unittest.cc

// Copyright 2020 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/permissions/permission_auditing_service.h"

#include <memory>
#include <vector>

#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "components/permissions/permission_usage_session.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace permissions {

ElementsAre;
IsEmpty;
UnorderedElementsAre;

namespace {

constexpr base::Time kTestTimes[] =;

constexpr ContentSettingsType kTestTypes[] =;

constexpr const char* kTestOrigins[] =;

PermissionUsageSession BuildUsageSession(base::Time usage_start_time,
                                         base::Time usage_end_time) {}

PermissionUsageSession BuildUsageSession(ContentSettingsType type,
                                         const url::Origin& origin) {}

}  // namespace

class PermissionAuditingServiceTest : public testing::Test {};

TEST_F(PermissionAuditingServiceTest, StorePermissionUsage) {}

TEST_F(PermissionAuditingServiceTest, GetLastPermissionUsageTime) {}

TEST_F(PermissionAuditingServiceTest, UpdateEndTime) {}

TEST_F(PermissionAuditingServiceTest, DeleteSessionsBetween) {}

TEST_F(PermissionAuditingServiceTest, OldSessionsAreExpired) {}

}  // namespace permissions