OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/Document.h" | 5 #include "core/dom/Document.h" |
6 #include "core/dom/Element.h" | 6 #include "core/dom/Element.h" |
7 #include "core/dom/StyleEngine.h" | 7 #include "core/dom/StyleEngine.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/layout/LayoutObject.h" | |
10 #include "core/testing/DummyPageHolder.h" | 9 #include "core/testing/DummyPageHolder.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
12 #include <memory> | 11 #include <memory> |
13 | 12 |
14 namespace blink { | 13 namespace blink { |
15 | 14 |
16 TEST(DragUpdateTest, AffectedByDragUpdate) { | 15 TEST(DragUpdateTest, AffectedByDragUpdate) { |
17 // Check that when dragging the div in the document below, you only get a | 16 // Check that when dragging the div in the document below, you only get a |
18 // single element style recalc. | 17 // single element style recalc. |
19 | 18 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 document.getElementById("div")->setDragged(true); | 97 document.getElementById("div")->setDragged(true); |
99 document.updateStyleAndLayout(); | 98 document.updateStyleAndLayout(); |
100 | 99 |
101 unsigned elementCount = | 100 unsigned elementCount = |
102 document.styleEngine().styleForElementCount() - startCount; | 101 document.styleEngine().styleForElementCount() - startCount; |
103 | 102 |
104 ASSERT_EQ(1U, elementCount); | 103 ASSERT_EQ(1U, elementCount); |
105 } | 104 } |
106 | 105 |
107 } // namespace blink | 106 } // namespace blink |
OLD | NEW |