#include "src/trace_redaction/redact_process_events.h"
#include "src/base/test/status_matchers.h"
#include "test/gtest_and_gmock.h"
#include "protos/perfetto/trace/ftrace/ftrace.gen.h"
#include "protos/perfetto/trace/ftrace/ftrace_event.gen.h"
#include "protos/perfetto/trace/ftrace/ftrace_event_bundle.gen.h"
#include "protos/perfetto/trace/ftrace/power.gen.h"
#include "protos/perfetto/trace/ftrace/sched.gen.h"
#include "protos/perfetto/trace/ftrace/task.gen.h"
#include "protos/perfetto/trace/trace.gen.h"
#include "protos/perfetto/trace/trace_packet.gen.h"
namespace perfetto::trace_redaction {
namespace {
constexpr uint64_t kCpu = …;
constexpr uint64_t kUidA = …;
constexpr uint64_t kUidB = …;
constexpr int32_t kNoParent = …;
constexpr int32_t kPidA = …;
constexpr int32_t kPidB = …;
constexpr int32_t kPidAA = …;
constexpr uint64_t kTimeA = …;
constexpr uint64_t kTimeB = …;
constexpr std::string_view kCommA = …;
constexpr std::string_view kCommB = …;
}
class RedactProcessEventsTest : public testing::Test { … };
TEST_F(RedactProcessEventsTest, RejectMissingPackageUid) { … }
TEST_F(RedactProcessEventsTest, RejectMissingTimeline) { … }
TEST_F(RedactProcessEventsTest, RejectMissingPacket) { … }
TEST_F(RedactProcessEventsTest, EmptyMissingPacket) { … }
class RedactNewTaskTest : public testing::Test { … };
TEST_F(RedactNewTaskTest, KeepCommInPackage) { … }
TEST_F(RedactNewTaskTest, ClearCommOutsidePackage) { … }
TEST_F(RedactNewTaskTest, KeepTaskInPackage) { … }
TEST_F(RedactNewTaskTest, DropTaskOutsidePackage) { … }
class RedactProcessFree : public testing::Test { … };
TEST_F(RedactProcessFree, KeepsCommInPackage) { … }
TEST_F(RedactProcessFree, DropsCommOutsidePackage) { … }
TEST_F(RedactProcessFree, KeepsCommAtProcessFree) { … }
TEST_F(RedactProcessFree, KeepTaskInPackage) { … }
TEST_F(RedactProcessFree, DropTaskOutsidePackage) { … }
class RedactRenameTest : public testing::Test { … };
TEST_F(RedactRenameTest, KeepCommInsidePackage) { … }
TEST_F(RedactRenameTest, ClearCommOutsidePackage) { … }
TEST_F(RedactRenameTest, KeepTaskInsidePackage) { … }
TEST_F(RedactRenameTest, DropTaskOutsidePackage) { … }
class RedactPrintTest : public testing::Test { … };
TEST_F(RedactPrintTest, KeepTaskInsidePackage) { … }
TEST_F(RedactPrintTest, DropTaskOutsidePackage) { … }
class RedactSuspendResumeTest : public testing::Test { … };
TEST_F(RedactSuspendResumeTest, KeepTaskInsidePackage) { … }
TEST_F(RedactSuspendResumeTest, FiltersByAllowlist) { … }
TEST_F(RedactSuspendResumeTest, DropTaskOutsidePackage) { … }
class RedactSchedBlockReasonTest : public testing::Test { … };
TEST_F(RedactSchedBlockReasonTest, KeepTaskInsidePackage) { … }
TEST_F(RedactSchedBlockReasonTest, DropTaskOutsidePackage) { … }
}