chromium/components/breadcrumbs/core/application_breadcrumbs_logger_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.

#include "components/breadcrumbs/core/application_breadcrumbs_logger.h"

#include "base/containers/circular_deque.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/metrics/user_metrics_action.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "components/breadcrumbs/core/breadcrumb_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"

namespace breadcrumbs {

namespace {

// The particular UserActions used here are not important, but real UserAction
// names are used to prevent a presubmit warning.
const char kUserAction1Name[] =;
const char kUserAction2Name[] =;
// An "InProductHelp.*" user action.
const char kInProductHelpUserActionName[] =;

// Returns a list of breadcrumb events logged so far.
const base::circular_deque<std::string>& GetEvents() {}

// Returns true if no breadcrumb events except "Startup" have been logged so
// far.
bool OnlyStartupEventLogged() {}

}  // namespace

// Test fixture for testing ApplicationBreadcrumbsLogger class.
class ApplicationBreadcrumbsLoggerTest : public PlatformTest {};

// Tests that a recorded UserAction is logged by the
// ApplicationBreadcrumbsLogger.
TEST_F(ApplicationBreadcrumbsLoggerTest, UserAction) {}

// Tests that not_user_triggered User Action does not show up in breadcrumbs.
TEST_F(ApplicationBreadcrumbsLoggerTest, LogNotUserTriggeredAction) {}

// Tests that "InProductHelp" UserActions are not logged by
// ApplicationBreadcrumbsLogger as they are very noisy.
TEST_F(ApplicationBreadcrumbsLoggerTest, SkipInProductHelpUserActions) {}

// Tests that memory pressure events are logged by ApplicationBreadcrumbsLogger.
// Test is flaky (https://crbug.com/1305253)
TEST_F(ApplicationBreadcrumbsLoggerTest, MemoryPressure) {}

}  // namespace breadcrumbs