chromium/third_party/blink/renderer/core/html/anchor_element_metrics_test.cc

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

#include "third_party/blink/renderer/core/html/anchor_element_metrics.h"

#include <optional>

#include "base/test/scoped_feature_list.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom-blink.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"

namespace blink {

class AnchorElementMetricsTest : public SimTest {};

constexpr int AnchorElementMetricsTest::kViewportWidth;
constexpr int AnchorElementMetricsTest::kViewportHeight;

TEST_F(AnchorElementMetricsTest, ViewportSize) {}

// Test for is_url_incremented_by_one.
TEST_F(AnchorElementMetricsTest, IsUrlIncrementedByOne) {}

// The main frame contains an anchor element, which contains an image element.
TEST_F(AnchorElementMetricsTest, AnchorFeatureImageLink) {}

// The main frame contains one anchor element without a text sibling.
TEST_F(AnchorElementMetricsTest, AnchorWithoutTextSibling) {}

// The main frame contains one anchor element with empty text siblings.
TEST_F(AnchorElementMetricsTest, AnchorWithEmptyTextSibling) {}

// The main frame contains one anchor element with a previous text sibling.
TEST_F(AnchorElementMetricsTest, AnchorWithPreviousTextSibling) {}

// The main frame contains one anchor element with a next text sibling.
TEST_F(AnchorElementMetricsTest, AnchorWithNextTextSibling) {}

// The main frame contains one anchor element with a font size of 23px.
TEST_F(AnchorElementMetricsTest, AnchorFontSize) {}

// The main frame contains one anchor element with a font weight of 438.
TEST_F(AnchorElementMetricsTest, AnchorFontWeight) {}

// The main frame contains an anchor element.
// Features of the element are extracted.
// Then the test scrolls down to check features again.
TEST_F(AnchorElementMetricsTest, AnchorFeatureExtract) {}

// The main frame contains an iframe. The iframe contains an anchor element.
// Features of the element are extracted.
// Then the test scrolls down in the main frame to check features again.
// Then the test scrolls down in the iframe to check features again.
TEST_F(AnchorElementMetricsTest, AnchorFeatureInIframe) {}

}  // namespace blink