chromium/third_party/blink/renderer/core/css/css_paint_value_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/css/css_paint_value.h"

#include <memory>

#include "base/auto_reset.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
#include "third_party/blink/renderer/core/css/css_syntax_definition.h"
#include "third_party/blink/renderer/core/css/mock_css_paint_image_generator.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style/style_generated_image.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/graphics/paint_generated_image.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"

_;
NiceMock;
Return;
ReturnRef;
Values;

namespace blink {
namespace {

enum {};

class CSSPaintValueTest : public RenderingTest,
                          public ::testing::WithParamInterface<unsigned>,
                          private ScopedCSSPaintAPIArgumentsForTest,
                          private ScopedOffMainThreadCSSPaintForTest {};

INSTANTIATE_TEST_SUITE_P();

// CSSPaintImageGenerator requires that CSSPaintImageGeneratorCreateFunction be
// a static method. As such, it cannot access a class member and so instead we
// store a pointer to the overriding generator globally.
MockCSSPaintImageGenerator* g_override_generator =;
CSSPaintImageGenerator* ProvideOverrideGenerator(
    const String&,
    const Document&,
    CSSPaintImageGenerator::Observer*) {}
}  // namespace

TEST_P(CSSPaintValueTest, DelayPaintUntilGeneratorReady) {}

// Regression test for crbug.com/998439. The problem is that GetImage is called
// on a new document. This test simulates the situation by having two different
// documents and call GetImage on different ones.
TEST_P(CSSPaintValueTest, GetImageCalledOnMultipleDocuments) {}

TEST_P(CSSPaintValueTest, NativeInvalidationPropertiesWithNoGenerator) {}

TEST_P(CSSPaintValueTest, CustomInvalidationPropertiesWithNoGenerator) {}

TEST_P(CSSPaintValueTest, PrintingMustFallbackToMainThread) {}

// Regression test for https://crbug.com/835589.
TEST_P(CSSPaintValueTest, DoNotPaintForLink) {}

// Regression test for https://crbug.com/835589.
TEST_P(CSSPaintValueTest, DoNotPaintWhenAncestorHasLink) {}

TEST_P(CSSPaintValueTest, BuildInputArgumentValuesNotCrash) {}

}  // namespace blink