chromium/chrome/browser/page_load_metrics/integration_tests/interaction_to_next_paint_browsertest.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string_view>

#include "base/test/trace_event_analyzer.h"
#include "build/build_config.h"
#include "chrome/browser/page_load_metrics/integration_tests/metric_integration_test.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_enums.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "content/common/content_navigation_policy.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "services/metrics/public/cpp/ukm_builders.h"

Bucket;
Value;
optional;
Query;
TraceAnalyzer;
TraceEventVector;
PageLoad;

class InteractionToNextPaintTest : public MetricIntegrationTest {};

bool InteractionToNextPaintTest::ExtractUKMPageLoadMetric(
    const ukm::TestUkmRecorder& ukm_recorder,
    std::string_view metric_name,
    int64_t* extracted_value) {}

int InteractionToNextPaintTest::ExtractMaxInteractionDurationFromTrace(
    TraceEventVector events) {}

bool InteractionToNextPaintTest::VerifyUKMAndTraceData(
    TraceAnalyzer& analyzer) {}

void InteractionToNextPaintTest::InjectWaitJavaScript() {}

void InteractionToNextPaintTest::WaitForFrameReady() {}

IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest, INP_ClickOnPage) {}

IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest, INP_ClickOnButton) {}

IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest, INP_ClickWithPresentation) {}

// Timeout of the PageLoadMetricsTestWaiter can happen though rarely, due to
// fast shutdown process. For example, the browser side observer could be
// destroyed before the UKM IPC is received.
// TODO(crbug.com/353730407): investigate and re-enable the test.
IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest,
                       DISABLED_INP_ReportBeforeNavigatingAway) {}

// Timeout of the PageLoadMetricsTestWaiter can happen though rarely, due to
// fast shutdown process. For example, the browser side observer could be
// destroyed before the UKM IPC is received.
// TODO(crbug.com/353730407): investigate and re-enable the test.
IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest,
                       DISABLED_INP_ReportBeforeNavigatingAwayToCrossOrigin) {}

IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest,
                       INP_ReportBeforeSwitchingTabAndNavigatingAway) {}

IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest,
                       INP_ReportBeforeSwitchingTabAndCloseBackgroundedTab) {}

// Timeout of the PageLoadMetricsTestWaiter can happen though rarely.
// TODO(crbug.com/353730407): investigate and re-enable the test.
IN_PROC_BROWSER_TEST_F(InteractionToNextPaintTest,
                       DISABLED_INP_ReportBeforeEnteringBFCache) {}