#ifdef UNSAFE_BUFFERS_BUILD
#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) { … }
}
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) { … }
}