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 <memory> |
5 #include "core/dom/Document.h" | 6 #include "core/dom/Document.h" |
6 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
7 #include "core/dom/StyleEngine.h" | 8 #include "core/dom/StyleEngine.h" |
8 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
9 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 #include <memory> | |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 TEST(DragUpdateTest, AffectedByDragUpdate) { | 15 TEST(DragUpdateTest, AffectedByDragUpdate) { |
16 // 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 |
17 // single element style recalc. | 17 // single element style recalc. |
18 | 18 |
19 std::unique_ptr<DummyPageHolder> dummyPageHolder = | 19 std::unique_ptr<DummyPageHolder> dummyPageHolder = |
20 DummyPageHolder::create(IntSize(800, 600)); | 20 DummyPageHolder::create(IntSize(800, 600)); |
21 Document& document = dummyPageHolder->document(); | 21 Document& document = dummyPageHolder->document(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 document.getElementById("div")->setDragged(true); | 94 document.getElementById("div")->setDragged(true); |
95 document.updateStyleAndLayout(); | 95 document.updateStyleAndLayout(); |
96 | 96 |
97 unsigned elementCount = | 97 unsigned elementCount = |
98 document.styleEngine().styleForElementCount() - startCount; | 98 document.styleEngine().styleForElementCount() - startCount; |
99 | 99 |
100 ASSERT_EQ(1U, elementCount); | 100 ASSERT_EQ(1U, elementCount); |
101 } | 101 } |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
OLD | NEW |