Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 1415143005: Preparation for enabling slimming paint synchronized painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments for the loop finding real root GraphicsLayer Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 6
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/html/HTMLIFrameElement.h" 10 #include "core/html/HTMLIFrameElement.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 loadURL("https://example.com/"); 145 loadURL("https://example.com/");
146 mainResource.complete("<iframe sandbox id=frame></iframe>"); 146 mainResource.complete("<iframe sandbox id=frame></iframe>");
147 147
148 auto* frameElement = toHTMLIFrameElement(document().getElementById("frame")) ; 148 auto* frameElement = toHTMLIFrameElement(document().getElementById("frame")) ;
149 auto* frameDocument = frameElement->contentDocument(); 149 auto* frameDocument = frameElement->contentDocument();
150 150
151 // Enable throttling for the child frame. 151 // Enable throttling for the child frame.
152 frameElement->setAttribute(styleAttr, "transform: translateY(480px)"); 152 frameElement->setAttribute(styleAttr, "transform: translateY(480px)");
153 compositeFrame(); 153 compositeFrame();
154 EXPECT_TRUE(frameDocument->view()->canThrottleRendering()); 154 EXPECT_TRUE(frameDocument->view()->canThrottleRendering());
155 EXPECT_EQ(DocumentLifecycle::PaintInvalidationClean, frameDocument->lifecycl e().state()); 155 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
156 EXPECT_EQ(DocumentLifecycle::PaintClean, frameDocument->lifecycle().stat e());
157 else
158 EXPECT_EQ(DocumentLifecycle::PaintInvalidationClean, frameDocument->life cycle().state());
156 159
157 // Mutating the throttled frame followed by a beginFrame will not result in 160 // Mutating the throttled frame followed by a beginFrame will not result in
158 // a complete lifecycle update. 161 // a complete lifecycle update.
159 frameElement->setAttribute(widthAttr, "50"); 162 frameElement->setAttribute(widthAttr, "50");
160 compositeFrame(); 163 compositeFrame();
161 EXPECT_EQ(DocumentLifecycle::StyleClean, frameDocument->lifecycle().state()) ; 164 EXPECT_EQ(DocumentLifecycle::StyleClean, frameDocument->lifecycle().state()) ;
162 165
163 // A hit test will force a complete lifecycle update. 166 // A hit test will force a complete lifecycle update.
164 webView().hitTestResultAt(WebPoint(0, 0)); 167 webView().hitTestResultAt(WebPoint(0, 0));
165 EXPECT_EQ(DocumentLifecycle::CompositingClean, frameDocument->lifecycle().st ate()); 168 EXPECT_EQ(DocumentLifecycle::CompositingClean, frameDocument->lifecycle().st ate());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Change the size of a div in the throttled frame. 247 // Change the size of a div in the throttled frame.
245 auto* divElement = frameElement->contentDocument()->getElementById("div"); 248 auto* divElement = frameElement->contentDocument()->getElementById("div");
246 divElement->setAttribute(styleAttr, "width: 50px"); 249 divElement->setAttribute(styleAttr, "width: 50px");
247 250
248 // Querying the width of the div should do a synchronous layout update even 251 // Querying the width of the div should do a synchronous layout update even
249 // though the frame is being throttled. 252 // though the frame is being throttled.
250 EXPECT_EQ(50, divElement->clientWidth()); 253 EXPECT_EQ(50, divElement->clientWidth());
251 } 254 }
252 255
253 } // namespace blink 256 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698