| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "bindings/core/v8/ScriptController.h" | 5 #include "bindings/core/v8/ScriptController.h" |
| 6 #include "bindings/core/v8/ScriptSourceCode.h" | 6 #include "bindings/core/v8/ScriptSourceCode.h" |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 for (const auto& child : layer->Children()) | 58 for (const auto& child : layer->Children()) |
| 59 PaintRecursively(child, display_items); | 59 PaintRecursively(child, display_items); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 class FrameThrottlingTest : public SimTest, | 64 class FrameThrottlingTest : public SimTest, |
| 65 public ::testing::WithParamInterface<bool>, | 65 public ::testing::WithParamInterface<bool>, |
| 66 private ScopedRootLayerScrollingForTest { | 66 private ScopedRootLayerScrollingForTest { |
| 67 protected: | 67 protected: |
| 68 FrameThrottlingTest() : ScopedRootLayerScrollingForTest(GetParam()) { | 68 FrameThrottlingTest() : ScopedRootLayerScrollingForTest(GetParam()) {} |
| 69 |
| 70 void SetUp() override { |
| 71 SimTest::SetUp(); |
| 69 WebView().Resize(WebSize(640, 480)); | 72 WebView().Resize(WebSize(640, 480)); |
| 70 } | 73 } |
| 71 | 74 |
| 72 SimDisplayItemList CompositeFrame() { | 75 SimDisplayItemList CompositeFrame() { |
| 73 SimDisplayItemList display_items = Compositor().BeginFrame(); | 76 SimDisplayItemList display_items = Compositor().BeginFrame(); |
| 74 // Ensure intersection observer notifications get delivered. | 77 // Ensure intersection observer notifications get delivered. |
| 75 testing::RunPendingTasks(); | 78 testing::RunPendingTasks(); |
| 76 return display_items; | 79 return display_items; |
| 77 } | 80 } |
| 78 | 81 |
| (...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 // the child. This behavior matches Safari. | 1136 // the child. This behavior matches Safari. |
| 1134 frame_element->setAttribute(styleAttr, "display: none"); | 1137 frame_element->setAttribute(styleAttr, "display: none"); |
| 1135 CompositeFrame(); | 1138 CompositeFrame(); |
| 1136 EXPECT_FALSE( | 1139 EXPECT_FALSE( |
| 1137 frame_element->contentDocument()->View()->CanThrottleRendering()); | 1140 frame_element->contentDocument()->View()->CanThrottleRendering()); |
| 1138 EXPECT_TRUE( | 1141 EXPECT_TRUE( |
| 1139 child_frame_element->contentDocument()->View()->CanThrottleRendering()); | 1142 child_frame_element->contentDocument()->View()->CanThrottleRendering()); |
| 1140 } | 1143 } |
| 1141 | 1144 |
| 1142 } // namespace blink | 1145 } // namespace blink |
| OLD | NEW |