| 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 "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/SVGNames.h" | 8 #include "core/SVGNames.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/dom/custom/CustomElementDefinition.h" | 10 #include "core/dom/custom/CustomElementDefinition.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 << data.name; | 201 << data.name; |
| 202 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name; | 202 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name; |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 | 205 |
| 206 TEST(CustomElementTest, | 206 TEST(CustomElementTest, |
| 207 CreateElement_TagNameCaseHandlingCreatingCustomElement) { | 207 CreateElement_TagNameCaseHandlingCreatingCustomElement) { |
| 208 // register a definition | 208 // register a definition |
| 209 std::unique_ptr<DummyPageHolder> holder(DummyPageHolder::create()); | 209 std::unique_ptr<DummyPageHolder> holder(DummyPageHolder::create()); |
| 210 CustomElementRegistry* registry = | 210 CustomElementRegistry* registry = |
| 211 holder->frame().localDOMWindow()->customElements(); | 211 holder->frame().domWindow()->customElements(); |
| 212 NonThrowableExceptionState shouldNotThrow; | 212 NonThrowableExceptionState shouldNotThrow; |
| 213 { | 213 { |
| 214 CEReactionsScope reactions; | 214 CEReactionsScope reactions; |
| 215 TestCustomElementDefinitionBuilder builder; | 215 TestCustomElementDefinitionBuilder builder; |
| 216 registry->define("a-a", builder, ElementDefinitionOptions(), | 216 registry->define("a-a", builder, ElementDefinitionOptions(), |
| 217 shouldNotThrow); | 217 shouldNotThrow); |
| 218 } | 218 } |
| 219 CustomElementDefinition* definition = | 219 CustomElementDefinition* definition = |
| 220 registry->definitionFor(CustomElementDescriptor("a-a", "a-a")); | 220 registry->definitionFor(CustomElementDescriptor("a-a", "a-a")); |
| 221 EXPECT_NE(nullptr, definition) << "a-a should be registered"; | 221 EXPECT_NE(nullptr, definition) << "a-a should be registered"; |
| 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 |