OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/dom/custom/CustomElement.h" | 5 #include "core/dom/custom/CustomElement.h" |
6 | 6 |
| 7 #include <ios> |
| 8 #include <memory> |
7 #include "core/HTMLNames.h" | 9 #include "core/HTMLNames.h" |
8 #include "core/SVGNames.h" | 10 #include "core/SVGNames.h" |
9 #include "core/dom/Document.h" | 11 #include "core/dom/Document.h" |
10 #include "core/dom/custom/CustomElementDefinition.h" | 12 #include "core/dom/custom/CustomElementDefinition.h" |
11 #include "core/dom/custom/CustomElementRegistry.h" | 13 #include "core/dom/custom/CustomElementRegistry.h" |
12 #include "core/dom/custom/CustomElementTestHelpers.h" | 14 #include "core/dom/custom/CustomElementTestHelpers.h" |
13 #include "core/html/HTMLElement.h" | 15 #include "core/html/HTMLElement.h" |
14 #include "core/testing/DummyPageHolder.h" | 16 #include "core/testing/DummyPageHolder.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
16 #include <ios> | |
17 #include <memory> | |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 static void testIsPotentialCustomElementName(const AtomicString& str, | 21 static void testIsPotentialCustomElementName(const AtomicString& str, |
22 bool expected) { | 22 bool expected) { |
23 if (expected) { | 23 if (expected) { |
24 EXPECT_TRUE(CustomElement::isValidName(str)) | 24 EXPECT_TRUE(CustomElement::isValidName(str)) |
25 << str << " should be a valid custom element name."; | 25 << str << " should be a valid custom element name."; |
26 } else { | 26 } else { |
27 EXPECT_FALSE(CustomElement::isValidName(str)) | 27 EXPECT_FALSE(CustomElement::isValidName(str)) |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 // create an element with an uppercase tag name | 223 // create an element with an uppercase tag name |
224 Document& document = holder->document(); | 224 Document& document = holder->document(); |
225 EXPECT_TRUE(document.isHTMLDocument()) | 225 EXPECT_TRUE(document.isHTMLDocument()) |
226 << "this test requires a HTML document"; | 226 << "this test requires a HTML document"; |
227 Element* element = document.createElement("A-A", shouldNotThrow); | 227 Element* element = document.createElement("A-A", shouldNotThrow); |
228 EXPECT_EQ(definition, element->customElementDefinition()); | 228 EXPECT_EQ(definition, element->customElementDefinition()); |
229 } | 229 } |
230 | 230 |
231 } // namespace blink | 231 } // namespace blink |
OLD | NEW |