#include "chrome/browser/performance_manager/public/user_tuning/performance_detection_manager.h"
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/location.h"
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/performance_manager/public/features.h"
#include "components/performance_manager/public/performance_manager.h"
#include "components/performance_manager/public/resource_attribution/page_context.h"
#include "components/performance_manager/test_support/test_harness_helper.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace performance_manager::user_tuning {
namespace {
class MockPerformanceDetectionManagerStatusObserver
: public PerformanceDetectionManager::StatusObserver { … };
class PerformanceDetectionManagerStatusObserver
: public PerformanceDetectionManager::StatusObserver { … };
class PerformanceDetectionManagerActionableTabObserver
: public PerformanceDetectionManager::ActionableTabsObserver { … };
class MockPerformanceDetectionManagerActionableTabsObserver
: public PerformanceDetectionManager::ActionableTabsObserver { … };
const int kNumHealthStatusForChange = …;
const int kUnhealthySystemCpuUsagePercentage = …;
const int kDegradedSystemCpuUsagePercentage = …;
}
class PerformanceDetectionManagerTest : public ChromeRenderViewHostTestHarness { … };
TEST_F(PerformanceDetectionManagerTest, ReturnsInstance) { … }
TEST_F(PerformanceDetectionManagerTest, HasInstance) { … }
TEST_F(PerformanceDetectionManagerTest, StatusObserverCalledOnObserve) { … }
TEST_F(PerformanceDetectionManagerTest, ActionableTabsObserverCalledOnObserve) { … }
TEST_F(PerformanceDetectionManagerTest, UpdatedStatusSentToObservers) { … }
TEST_F(PerformanceDetectionManagerTest, UpdatedActionableTabsSentToObservers) { … }
TEST_F(PerformanceDetectionManagerTest, DiscardMetricsRecorded) { … }
}