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

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

Issue 2097463002: Add backup element queue to CustomElementReactionStack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc nits Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/custom/CustomElementReactionStackTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStackTest.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStackTest.cpp
index 7edc0c93199395633a97ce696776aa603961b70c..403dc8fca82d1f674f7dc7fbded918a464514467 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStackTest.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementReactionStackTest.cpp
@@ -21,7 +21,7 @@ TEST(CustomElementReactionStackTest, one)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
stack->popInvokingReactions();
EXPECT_EQ(log, std::vector<char>({'a'}))
@@ -34,8 +34,8 @@ TEST(CustomElementReactionStackTest, multipleElements)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('b', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('b', log)}));
stack->popInvokingReactions();
EXPECT_EQ(log, std::vector<char>({'a', 'b'}))
@@ -48,7 +48,7 @@ TEST(CustomElementReactionStackTest, popTopEmpty)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
stack->push();
stack->popInvokingReactions();
@@ -62,9 +62,9 @@ TEST(CustomElementReactionStackTest, popTop)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('a', log)}));
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('b', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('b', log)}));
stack->popInvokingReactions();
EXPECT_EQ(log, std::vector<char>({'b'}))
@@ -79,9 +79,9 @@ TEST(CustomElementReactionStackTest, requeueingDoesNotReorderElements)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(element, new TestReaction({new Log('a', log)}));
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('z', log)}));
- stack->enqueue(element, new TestReaction({new Log('b', log)}));
+ stack->enqueueToCurrentQueue(element, new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('z', log)}));
+ stack->enqueueToCurrentQueue(element, new TestReaction({new Log('b', log)}));
stack->popInvokingReactions();
EXPECT_EQ(log, std::vector<char>({'a', 'b', 'z'}))
@@ -96,11 +96,11 @@ TEST(CustomElementReactionStackTest, oneReactionQueuePerElement)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(element, new TestReaction({new Log('a', log)}));
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('z', log)}));
+ stack->enqueueToCurrentQueue(element, new TestReaction({new Log('a', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('z', log)}));
stack->push();
- stack->enqueue(CreateElement("a"), new TestReaction({new Log('y', log)}));
- stack->enqueue(element, new TestReaction({new Log('b', log)}));
+ stack->enqueueToCurrentQueue(CreateElement("a"), new TestReaction({new Log('y', log)}));
+ stack->enqueueToCurrentQueue(element, new TestReaction({new Log('b', log)}));
stack->popInvokingReactions();
EXPECT_EQ(log, std::vector<char>({'y', 'a', 'b'}))
@@ -130,7 +130,7 @@ public:
}
void run(Element*) override
{
- m_stack->enqueue(m_element, m_reaction);
+ m_stack->enqueueToCurrentQueue(m_element, m_reaction);
}
private:
Member<CustomElementReactionStack> m_stack;
@@ -146,7 +146,7 @@ TEST(CustomElementReactionStackTest, enqueueFromReaction)
CustomElementReactionStack* stack = new CustomElementReactionStack();
stack->push();
- stack->enqueue(element, new TestReaction({
+ stack->enqueueToCurrentQueue(element, new TestReaction({
new EnqueueToStack(stack, element,
new TestReaction({ new Log('a', log) }) )
}));
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementReactionStack.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698