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

Unified Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 2470793002: Revert of Use intersection observer to control frame throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
index 7e022a42b2eabb0f0b29719a3d16f0b2ced210ff..b2e6e095f0f9840e161dccf0f2c46bc41dcfda51 100644
--- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "bindings/core/v8/ScriptController.h"
-#include "bindings/core/v8/ScriptSourceCode.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
#include "core/frame/FrameView.h"
@@ -779,7 +778,7 @@
// observer notifications.
frameElement->contentDocument()
->view()
- ->updateRenderThrottlingStatusForTesting();
+ ->notifyRenderThrottlingObserversForTesting();
EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
EXPECT_TRUE(
childFrameElement->contentDocument()->view()->canThrottleRendering());
@@ -787,33 +786,9 @@
// Both frames should still be throttled after the second notification.
childFrameElement->contentDocument()
->view()
- ->updateRenderThrottlingStatusForTesting();
+ ->notifyRenderThrottlingObserversForTesting();
EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
EXPECT_TRUE(
- childFrameElement->contentDocument()->view()->canThrottleRendering());
-
- // Move the frame back on screen but don't update throttling yet.
- frameElement->setAttribute(styleAttr, "transform: translateY(0px)");
- compositor().beginFrame();
- EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
- EXPECT_TRUE(
- childFrameElement->contentDocument()->view()->canThrottleRendering());
-
- // Update throttling for the child. It should remain throttled because the
- // parent is still throttled.
- childFrameElement->contentDocument()
- ->view()
- ->updateRenderThrottlingStatusForTesting();
- EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
- EXPECT_TRUE(
- childFrameElement->contentDocument()->view()->canThrottleRendering());
-
- // Updating throttling on the parent should unthrottle both frames.
- frameElement->contentDocument()
- ->view()
- ->updateRenderThrottlingStatusForTesting();
- EXPECT_FALSE(frameElement->contentDocument()->view()->canThrottleRendering());
- EXPECT_FALSE(
childFrameElement->contentDocument()->view()->canThrottleRendering());
}
@@ -899,33 +874,4 @@
compositeFrame();
}
-TEST_F(FrameThrottlingTest, AllowOneAnimationFrame) {
- webView().settings()->setJavaScriptEnabled(true);
-
- // Prepare a page with two cross origin frames (from the same origin so they
- // are able to access eachother).
- SimRequest mainResource("https://example.com/", "text/html");
- SimRequest frameResource("https://thirdparty.com/frame.html", "text/html");
- loadURL("https://example.com/");
- mainResource.complete(
- "<iframe id=frame style=\"position: fixed; top: -10000px\" "
- "src='https://thirdparty.com/frame.html'></iframe>");
-
- frameResource.complete(
- "<script>"
- "window.requestAnimationFrame(() => { window.didRaf = true; });"
- "</script>");
-
- auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
- compositeFrame();
- EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
-
- LocalFrame* localFrame = toLocalFrame(frameElement->contentFrame());
- v8::HandleScope scope(v8::Isolate::GetCurrent());
- v8::Local<v8::Value> result =
- localFrame->script().executeScriptInMainWorldAndReturnValue(
- ScriptSourceCode("window.didRaf;"));
- EXPECT_TRUE(result->IsTrue());
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698