Index: third_party/WebKit/Source/core/dom/NodeTest.cpp |
diff --git a/third_party/WebKit/Source/core/dom/NodeTest.cpp b/third_party/WebKit/Source/core/dom/NodeTest.cpp |
index b1603d5524272e63ded96604b04d7af2c0173678..c57529bc923ce8c3f8598ae961878f40ca900018 100644 |
--- a/third_party/WebKit/Source/core/dom/NodeTest.cpp |
+++ b/third_party/WebKit/Source/core/dom/NodeTest.cpp |
@@ -36,4 +36,24 @@ TEST_F(NodeTest, canStartSelectionWithShadowDOM) |
EXPECT_FALSE(one->firstChild()->canStartSelection()); |
} |
+TEST_F(NodeTest, customElementState) |
+{ |
+ const char* bodyContent = "<div id=div></div>"; |
+ setBodyContent(bodyContent); |
+ Element* div = document().getElementById("div"); |
+ EXPECT_EQ(CustomElementState::Uncustomized, div->getCustomElementState()); |
+ EXPECT_TRUE(div->isDefinedCustomElement()); |
dominicc (has gone to gerrit)
2016/05/18 07:56:22
I think in practice code needs to distinguish thre
kojii
2016/05/18 08:32:15
When you need to distinguish the three, getCustomE
|
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState()); |
+ |
+ div->setCustomElementState(CustomElementState::Undefined); |
+ EXPECT_EQ(CustomElementState::Undefined, div->getCustomElementState()); |
+ EXPECT_FALSE(div->isDefinedCustomElement()); |
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState()); |
+ |
+ div->setCustomElementState(CustomElementState::Customized); |
+ EXPECT_EQ(CustomElementState::Customized, div->getCustomElementState()); |
+ EXPECT_TRUE(div->isDefinedCustomElement()); |
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState()); |
+} |
+ |
} // namespace blink |