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 "platform/Logging.h" | 7 #include "platform/Logging.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 UChar32 from, to; | 103 UChar32 from, to; |
104 } ranges[] = { | 104 } ranges[] = { |
105 { 'A', 'Z' }, | 105 { 'A', 'Z' }, |
106 }; | 106 }; |
107 for (auto range : ranges) { | 107 for (auto range : ranges) { |
108 for (UChar32 c = range.from; c <= range.to; ++c) | 108 for (UChar32 c = range.from; c <= range.to; ++c) |
109 TestIsPotentialCustomElementNameChar(c, false); | 109 TestIsPotentialCustomElementNameChar(c, false); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
| 113 TEST(CustomElementTest, TestHyphenContainingElementNames) |
| 114 { |
| 115 EXPECT_TRUE(CustomElement::isValidName("valid-name")); |
| 116 |
| 117 EXPECT_FALSE(CustomElement::isValidName("annotation-xml")); |
| 118 EXPECT_FALSE(CustomElement::isValidName("color-profile")); |
| 119 EXPECT_FALSE(CustomElement::isValidName("font-face")); |
| 120 EXPECT_FALSE(CustomElement::isValidName("font-face-src")); |
| 121 EXPECT_FALSE(CustomElement::isValidName("font-face-uri")); |
| 122 EXPECT_FALSE(CustomElement::isValidName("font-face-format")); |
| 123 EXPECT_FALSE(CustomElement::isValidName("font-face-name")); |
| 124 EXPECT_FALSE(CustomElement::isValidName("missing-glyph")); |
| 125 } |
| 126 |
113 } // namespace blink | 127 } // namespace blink |
OLD | NEW |