Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp

Issue 2200613002: The HTML parser synchronously creates custom elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Eliminate redundant TODOs. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp
index 96321e13cc3ce80232d24c1a4d4ea8c3d0e5be7d..9f8d84ae6cd358110b59ea894de6877c78b896d1 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistryTest.cpp
@@ -25,63 +25,21 @@
namespace blink {
-class CustomElementsRegistryTestBase : public ::testing::Test {
+class CustomElementsRegistryTest : public ::testing::Test {
protected:
- virtual Document& document() = 0;
- virtual CustomElementsRegistry& registry() = 0;
-
- void collectCandidates(
- const CustomElementDescriptor& desc,
- HeapVector<Member<Element>>* elements)
- {
- registry().collectCandidates(desc, elements);
- }
-};
-
-class CustomElementsRegistryTest : public CustomElementsRegistryTestBase {
-protected:
- void SetUp() override
- {
- CustomElementsRegistryTestBase::SetUp();
-
- m_document = HTMLDocument::create();
- m_document->appendChild(CreateElement("html").inDocument(m_document));
-
- m_registry = CustomElementsRegistry::create(m_document);
- }
-
- void TearDown() override
+ void SetUp()
{
- m_document = nullptr;
- m_registry = nullptr;
- CustomElementsRegistryTestBase::TearDown();
- }
-
- Document& document() override { return *m_document; }
- CustomElementsRegistry& registry() override { return *m_registry; }
-
-private:
- Persistent<Document> m_document;
- Persistent<CustomElementsRegistry> m_registry;
-};
-
-class CustomElementsRegistryFrameTest : public CustomElementsRegistryTestBase {
-protected:
- void SetUp() override
- {
- CustomElementsRegistryTestBase::SetUp();
m_page.reset(DummyPageHolder::create(IntSize(1, 1)).release());
}
- void TearDown() override
+ void TearDown()
{
m_page = nullptr;
- CustomElementsRegistryTestBase::TearDown();
}
- Document& document() override { return m_page->document(); }
+ Document& document() { return m_page->document(); }
- CustomElementsRegistry& registry() override
+ CustomElementsRegistry& registry()
{
return *m_page->frame().localDOMWindow()->customElements();
}
@@ -91,6 +49,13 @@ protected:
return ScriptState::forMainWorld(&m_page->frame());
}
+ void collectCandidates(
+ const CustomElementDescriptor& desc,
+ HeapVector<Member<Element>>* elements)
+ {
+ registry().collectCandidates(desc, elements);
+ }
+
ShadowRoot* attachShadowTo(Element* element)
{
NonThrowableExceptionState noExceptions;
@@ -361,7 +326,7 @@ public:
}
};
-TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements)
+TEST_F(CustomElementsRegistryTest, define_upgradesInDocumentElements)
{
ScriptForbiddenScope doNotRelyOnScript;
@@ -408,7 +373,7 @@ TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements)
<< "upgrade should not invoke other callbacks";
}
-TEST_F(CustomElementsRegistryFrameTest, attributeChangedCallback)
+TEST_F(CustomElementsRegistryTest, attributeChangedCallback)
{
ScriptForbiddenScope doNotRelyOnScript;
@@ -445,7 +410,7 @@ TEST_F(CustomElementsRegistryFrameTest, attributeChangedCallback)
<< "upgrade should not invoke other callbacks";
}
-TEST_F(CustomElementsRegistryFrameTest, disconnectedCallback)
+TEST_F(CustomElementsRegistryTest, disconnectedCallback)
{
ScriptForbiddenScope doNotRelyOnScript;

Powered by Google App Engine
This is Rietveld 408576698