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/CustomElementReactionStack.h" | 5 #include "core/dom/custom/CustomElementReactionStack.h" |
6 | 6 |
7 #include <initializer_list> | 7 #include <initializer_list> |
8 #include <vector> | 8 #include <vector> |
9 #include "core/dom/custom/CustomElementReaction.h" | 9 #include "core/dom/custom/CustomElementReaction.h" |
10 #include "core/dom/custom/CustomElementReactionTestHelpers.h" | 10 #include "core/dom/custom/CustomElementReactionTestHelpers.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 }; | 139 }; |
140 | 140 |
141 TEST(CustomElementReactionStackTest, enqueueFromReaction) { | 141 TEST(CustomElementReactionStackTest, enqueueFromReaction) { |
142 std::vector<char> log; | 142 std::vector<char> log; |
143 | 143 |
144 Element* element = CreateElement("a"); | 144 Element* element = CreateElement("a"); |
145 | 145 |
146 CustomElementReactionStack* stack = new CustomElementReactionStack(); | 146 CustomElementReactionStack* stack = new CustomElementReactionStack(); |
147 stack->push(); | 147 stack->push(); |
148 stack->enqueueToCurrentQueue( | 148 stack->enqueueToCurrentQueue( |
149 element, new TestReaction({new EnqueueToStack( | 149 element, |
150 stack, element, new TestReaction({new Log('a', log)}))})); | 150 new TestReaction({new EnqueueToStack( |
| 151 stack, element, new TestReaction({new Log('a', log)}))})); |
151 stack->popInvokingReactions(); | 152 stack->popInvokingReactions(); |
152 | 153 |
153 EXPECT_EQ(log, std::vector<char>({'a'})) << "enqueued reaction from another " | 154 EXPECT_EQ(log, std::vector<char>({'a'})) << "enqueued reaction from another " |
154 "reaction should run in the same " | 155 "reaction should run in the same " |
155 "invoke"; | 156 "invoke"; |
156 } | 157 } |
157 | 158 |
158 } // namespace blink | 159 } // namespace blink |
OLD | NEW |