| 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> |
| 8 #include <vector> |
| 7 #include "core/dom/custom/CustomElementReaction.h" | 9 #include "core/dom/custom/CustomElementReaction.h" |
| 8 #include "core/dom/custom/CustomElementReactionTestHelpers.h" | 10 #include "core/dom/custom/CustomElementReactionTestHelpers.h" |
| 9 #include "core/dom/custom/CustomElementTestHelpers.h" | 11 #include "core/dom/custom/CustomElementTestHelpers.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "wtf/text/AtomicString.h" | 13 #include "wtf/text/AtomicString.h" |
| 12 #include <initializer_list> | |
| 13 #include <vector> | |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 TEST(CustomElementReactionStackTest, one) { | 17 TEST(CustomElementReactionStackTest, one) { |
| 18 std::vector<char> log; | 18 std::vector<char> log; |
| 19 | 19 |
| 20 CustomElementReactionStack* stack = new CustomElementReactionStack(); | 20 CustomElementReactionStack* stack = new CustomElementReactionStack(); |
| 21 stack->push(); | 21 stack->push(); |
| 22 stack->enqueueToCurrentQueue(CreateElement("a"), | 22 stack->enqueueToCurrentQueue(CreateElement("a"), |
| 23 new TestReaction({new Log('a', log)})); | 23 new TestReaction({new Log('a', log)})); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 element, new TestReaction({new EnqueueToStack( | 149 element, new TestReaction({new EnqueueToStack( |
| 150 stack, element, new TestReaction({new Log('a', log)}))})); | 150 stack, element, new TestReaction({new Log('a', log)}))})); |
| 151 stack->popInvokingReactions(); | 151 stack->popInvokingReactions(); |
| 152 | 152 |
| 153 EXPECT_EQ(log, std::vector<char>({'a'})) << "enqueued reaction from another " | 153 EXPECT_EQ(log, std::vector<char>({'a'})) << "enqueued reaction from another " |
| 154 "reaction should run in the same " | 154 "reaction should run in the same " |
| 155 "invoke"; | 155 "invoke"; |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace blink | 158 } // namespace blink |
| OLD | NEW |