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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 2504573002: Don't call isURLAllowed() from layout. (Closed)
Patch Set: Fix bad formatting that caused clang-format-diff to get confused. 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
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
index 8de4a4d15206652b39c6f49ded06feb823b363fb..5fc9f7692ff8018e060b3fa80c3358d73a2b3778 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp
@@ -702,12 +702,10 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfIframeInScrolledDiv) {
setBodyInnerHTML(
"<style>body { margin: 0; }</style>"
"<div style='width: 200; height: 8000px'></div>"
- "<iframe id=frame src='http://test.com' width='500' height='500' "
+ "<iframe src='http://test.com' width='500' height='500' "
"frameBorder='0'>"
"</iframe>");
-
- Document& frameDocument = setupChildIframe(
- "frame",
+ setChildFrameHTML(
"<style>body { margin: 0; } #target { width: 200px; height: 200px; "
"will-change: transform}</style><div id=target></div>");
@@ -716,7 +714,7 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfIframeInScrolledDiv) {
ScrollOffset(0.0, 8000.0), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
- Element* target = frameDocument.getElementById("target");
+ Element* target = childDocument().getElementById("target");
ASSERT_TRUE(target);
EXPECT_RECT_EQ(
@@ -731,26 +729,25 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfScrolledIframe) {
setBodyInnerHTML(
"<style>body { margin: 0; } ::-webkit-scrollbar { display: none; "
"}</style>"
- "<iframe id=frame src='http://test.com' width='500' height='500' "
+ "<iframe src='http://test.com' width='500' height='500' "
"frameBorder='0'>"
"</iframe>");
-
- Document& frameDocument =
- setupChildIframe("frame",
- "<style>body { margin: 0; } #target { width: 200px; "
- "height: 8000px;}</style><div id=target></div>");
+ setChildFrameHTML(
+ "<style>body { margin: 0; } #target { width: 200px; "
+ "height: 8000px;}</style><div id=target></div>");
document().view()->updateAllLifecyclePhases();
// Scroll 7500 pixels down to bring the scrollable area to the bottom.
- frameDocument.view()->layoutViewportScrollableArea()->setScrollOffset(
+ childDocument().view()->layoutViewportScrollableArea()->setScrollOffset(
ScrollOffset(0.0, 7500.0), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
- ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer());
+ ASSERT_TRUE(childDocument().view()->layoutViewItem().hasLayer());
EXPECT_RECT_EQ(
IntRect(0, 3500, 500, 4500),
- recomputeInterestRect(frameDocument.view()
+ recomputeInterestRect(childDocument()
+ .view()
->layoutViewItem()
.enclosingLayer()
->graphicsLayerBackingForScrolling()));
@@ -764,28 +761,27 @@ TEST_P(CompositedLayerMappingTest, InterestRectOfIframeWithContentBoxOffset) {
setBodyInnerHTML(
"<style>body { margin: 0; } #frame { border: 10px solid black; } "
"::-webkit-scrollbar { display: none; }</style>"
- "<iframe id=frame src='http://test.com' width='500' height='500' "
+ "<iframe src='http://test.com' width='500' height='500' "
"frameBorder='0'>"
"</iframe>");
-
- Document& frameDocument =
- setupChildIframe("frame",
- "<style>body { margin: 0; } #target { width: 200px; "
- "height: 8000px;}</style> <div id=target></div>");
+ setChildFrameHTML(
+ "<style>body { margin: 0; } #target { width: 200px; "
+ "height: 8000px;}</style> <div id=target></div>");
document().view()->updateAllLifecyclePhases();
// Scroll 3000 pixels down to bring the scrollable area to somewhere in the
// middle.
- frameDocument.view()->layoutViewportScrollableArea()->setScrollOffset(
+ childDocument().view()->layoutViewportScrollableArea()->setScrollOffset(
ScrollOffset(0.0, 3000.0), ProgrammaticScroll);
document().view()->updateAllLifecyclePhases();
- ASSERT_TRUE(frameDocument.view()->layoutViewItem().hasLayer());
+ ASSERT_TRUE(childDocument().view()->layoutViewItem().hasLayer());
// The width is 485 pixels due to the size of the scrollbar.
EXPECT_RECT_EQ(
IntRect(0, 0, 500, 7500),
- recomputeInterestRect(frameDocument.view()
+ recomputeInterestRect(childDocument()
+ .view()
->layoutViewItem()
.enclosingLayer()
->graphicsLayerBackingForScrolling()));

Powered by Google App Engine
This is Rietveld 408576698