| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h" |
| #include "third_party/blink/renderer/core/frame/use_counter.h" |
| #include "third_party/blink/renderer/core/html/html_html_element.h" |
| #include "third_party/blink/renderer/core/testing/dummy_page_holder.h" |
| |
| namespace blink { |
| |
| TEST(CSSParsingUtilsTest, BasicShapeUseCount) { |
| auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); |
| Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); |
| Document& document = dummy_page_holder->GetDocument(); |
| WebFeature feature = WebFeature::kCSSBasicShape; |
| EXPECT_FALSE(UseCounter::IsCounted(document, feature)); |
| document.documentElement()->SetInnerHTMLFromString( |
| "<style>span { shape-outside: circle(); }</style>"); |
| EXPECT_TRUE(UseCounter::IsCounted(document, feature)); |
| } |
| |
| } // namespace blink |