chromium/chrome/browser/page_load_metrics/integration_tests/layout_instability_browsertest.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 "chrome/browser/page_load_metrics/integration_tests/metric_integration_test.h"

#include "base/test/trace_event_analyzer.h"
#include "build/build_config.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/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "services/metrics/public/cpp/ukm_builders.h"

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

class LayoutInstabilityTest : public MetricIntegrationTest {};

void LayoutInstabilityTest::RunWPT(const std::string& test_file,
                                   ShiftFrame frame,
                                   uint64_t num_layout_shifts,
                                   bool check_UKM_UMA_metrics) {}

double LayoutInstabilityTest::CheckTraceData(Value::List& expectations,
                                             TraceAnalyzer& analyzer) {}

void LayoutInstabilityTest::CheckSources(const Value::List& expected_sources,
                                         const Value::List& trace_sources) {}

void LayoutInstabilityTest::CheckUKMAndUMAMetrics(double expect_score) {}

std::pair<double, double> LayoutInstabilityTest::GetCLSFromList(
    Value::List& entry_records_list) {}

void LayoutInstabilityTest::CheckUKMAndUMAMetricsWithValues(
    double totalCls,
    double normalizedCls) {}

void LayoutInstabilityTest::WaitForFrameReady() {}

IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest, SimpleBlockMovement) {}

// TODO(crbug.com/40916883): Disable this test on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_Sources_Enclosure
#else
#define MAYBE_Sources_Enclosure
#endif
IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest, MAYBE_Sources_Enclosure) {}

// TODO(crbug.com/40250247): Fix and reenable the test.
IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest, DISABLED_Sources_MaxImpact) {}

// This test verifies the layout shift score in the sub-frame is recorded
// correctly in both UKM and UMA, the layout shift score in sub-frame is
// calculated by applying a sub-frame weighting factor to the total score.
IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest, OOPIFSubframeWeighting) {}

IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest,
                       CumulativeLayoutShift_OneSecondGap) {}

// TODO(crbug.com/40940689): Disable this test on Win10
#if BUILDFLAG(IS_WIN)
#define MAYBE_CumulativeLayoutShift_hadRecentInput
#else
#define MAYBE_CumulativeLayoutShift_hadRecentInput
#endif
IN_PROC_BROWSER_TEST_F(LayoutInstabilityTest,
                       MAYBE_CumulativeLayoutShift_hadRecentInput) {}