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

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

Issue 2692993003: Invalidate throttling-related dirty bits when changing cross-origin status. (Closed)
Patch Set: none Created 3 years, 10 months 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/paint/PaintLayerClipper.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 ec7b2af691971b60086c51126be29e2b8416dd5e..586200d17cf1a77e0cd40112c2d8c7979ebf8572 100644
--- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
@@ -426,6 +426,44 @@ TEST_P(FrameThrottlingTest, ChangeStyleInThrottledFrame) {
EXPECT_TRUE(displayItems2.contains(SimCanvas::Rect, "green"));
}
+TEST_P(FrameThrottlingTest, ChangeOriginInThrottledFrame) {
+ // Create a hidden frame which is throttled.
+ SimRequest mainResource("http://example.com/", "text/html");
+ SimRequest frameResource("http://sub.example.com/iframe.html", "text/html");
+ loadURL("http://example.com/");
+ mainResource.complete(
+ "<iframe style='position: absolute; top: 10000px' id=frame "
+ "src=http://sub.example.com/iframe.html></iframe>");
+ frameResource.complete("");
+
+ auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
+
+ compositeFrame();
+
+ EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
+ EXPECT_TRUE(
+ frameElement->contentDocument()->frame()->isCrossOriginSubframe());
+ EXPECT_FALSE(frameElement->contentDocument()
+ ->view()
+ ->layoutView()
+ ->needsPaintPropertyUpdate());
+
+ NonThrowableExceptionState exceptionState;
+
+ // Security policy requires setting domain on both frames.
+ document().setDomain(String("example.com"), exceptionState);
+ frameElement->contentDocument()->setDomain(String("example.com"),
+ exceptionState);
+
+ EXPECT_FALSE(
+ frameElement->contentDocument()->frame()->isCrossOriginSubframe());
+ EXPECT_FALSE(frameElement->contentDocument()->view()->canThrottleRendering());
+ EXPECT_TRUE(frameElement->contentDocument()
+ ->view()
+ ->layoutView()
+ ->needsPaintPropertyUpdate());
+}
+
TEST_P(FrameThrottlingTest, ThrottledFrameWithFocus) {
webView().settings()->setJavaScriptEnabled(true);
webView().settings()->setAcceleratedCompositingEnabled(true);
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698