| Index: third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp
|
| index 4f918bb548d08c0c2ca0a1f401b2f66d00685e72..defad7588d2f02fa5d3ceb69cd681781d3c529f3 100644
|
| --- a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistryTest.cpp
|
| @@ -414,6 +414,32 @@ TEST_F(CustomElementRegistryTest, adoptedCallback) {
|
| << "adoptNode() should not invoke other callbacks";
|
| }
|
|
|
| +TEST_F(CustomElementRegistryTest, lookupCustomElementDefinition) {
|
| + NonThrowableExceptionState shouldNotThrow;
|
| + TestCustomElementDefinitionBuilder builder;
|
| + CustomElementDefinition* definitionA = registry().define(
|
| + "a-a", builder, ElementDefinitionOptions(), shouldNotThrow);
|
| + ElementDefinitionOptions options;
|
| + options.setExtends("div");
|
| + CustomElementDefinition* definitionB =
|
| + registry().define("b-b", builder, options, shouldNotThrow);
|
| + // look up defined autonomous custom element
|
| + CustomElementDefinition* definition = registry().definitionFor(
|
| + CustomElementDescriptor(CustomElementDescriptor("a-a", "a-a")));
|
| + EXPECT_NE(nullptr, definition) << "a-a, a-a should be registered";
|
| + EXPECT_EQ(definitionA, definition);
|
| + // look up undefined autonomous custom element
|
| + definition = registry().definitionFor(CustomElementDescriptor("a-a", "div"));
|
| + EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered";
|
| + // look up defined customized built-in element
|
| + definition = registry().definitionFor(CustomElementDescriptor("b-b", "div"));
|
| + EXPECT_NE(nullptr, definition) << "b-b, div should be registered";
|
| + EXPECT_EQ(definitionB, definition);
|
| + // look up undefined customized built-in element
|
| + definition = registry().definitionFor(CustomElementDescriptor("a-a", "div"));
|
| + EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered";
|
| +}
|
| +
|
| // TODO(dominicc): Add tests which adjust the "is" attribute when type
|
| // extensions are implemented.
|
|
|
|
|