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

Unified Diff: third_party/WebKit/Source/core/page/PrintContextTest.cpp

Issue 1511183003: Reland: Fix incorrect sign in scroll and content box offset in absoluteToLocalPoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/compositing/CompositedLayerMappingTest.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/core/page/PrintContextTest.cpp
diff --git a/third_party/WebKit/Source/core/page/PrintContextTest.cpp b/third_party/WebKit/Source/core/page/PrintContextTest.cpp
index 04b70f498a00748e8bc4f25fa320905756eed244..b8328a794561c75b7f98bec4b25b501a3a3d9a39 100644
--- a/third_party/WebKit/Source/core/page/PrintContextTest.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContextTest.cpp
@@ -9,10 +9,8 @@
#include "core/frame/FrameView.h"
#include "core/html/HTMLElement.h"
-#include "core/html/HTMLIFrameElement.h"
#include "core/layout/LayoutTestHelper.h"
#include "core/layout/LayoutView.h"
-#include "core/loader/EmptyClients.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/PaintLayerPainter.h"
#include "core/testing/DummyPageHolder.h"
@@ -275,20 +273,9 @@ TEST_F(PrintContextFrameTest, WithSubframe)
"<iframe id='frame' src='http://b.com/' width='500' height='500'"
" style='border-width: 5px; margin: 5px; position: absolute; top: 90px; left: 90px'></iframe>");
- HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById("frame"));
- OwnPtrWillBeRawPtr<FrameLoaderClient> frameLoaderClient = FrameLoaderClientWithParent::create(document().frame());
- RefPtrWillBePersistent<LocalFrame> subframe = LocalFrame::create(frameLoaderClient.get(), document().frame()->host(), &iframe);
- subframe->setView(FrameView::create(subframe.get(), IntSize(500, 500)));
- subframe->init();
- static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(subframe.get());
- document().frame()->host()->incrementSubframeCount();
-
- Document& frameDocument = *iframe.contentDocument();
- frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://b.com/"));
- frameDocument.body()->setInnerHTML(absoluteBlockHtmlForLink(50, 60, 70, 80, "#fragment")
+ setupChildIframe("frame", absoluteBlockHtmlForLink(50, 60, 70, 80, "#fragment")
+ absoluteBlockHtmlForLink(150, 160, 170, 180, "http://www.google.com")
- + absoluteBlockHtmlForLink(250, 260, 270, 280, "http://www.google.com#fragment"),
- ASSERT_NO_EXCEPTION);
+ + absoluteBlockHtmlForLink(250, 260, 270, 280, "http://www.google.com#fragment"));
printSinglePage(canvas);
@@ -298,10 +285,6 @@ TEST_F(PrintContextFrameTest, WithSubframe)
EXPECT_SKRECT_EQ(250, 260, 170, 180, operations[0].rect);
EXPECT_EQ(MockCanvas::DrawRect, operations[1].type);
EXPECT_SKRECT_EQ(350, 360, 270, 280, operations[1].rect);
-
- subframe->detach(FrameDetachType::Remove);
- static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(nullptr);
- document().frame()->host()->decrementSubframeCount();
}
TEST_F(PrintContextFrameTest, WithScrolledSubframe)
@@ -312,24 +295,13 @@ TEST_F(PrintContextFrameTest, WithScrolledSubframe)
"<iframe id='frame' src='http://b.com/' width='500' height='500'"
" style='border-width: 5px; margin: 5px; position: absolute; top: 90px; left: 90px'></iframe>");
- HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById("frame"));
- OwnPtrWillBeRawPtr<FrameLoaderClient> frameLoaderClient = FrameLoaderClientWithParent::create(document().frame());
- RefPtrWillBePersistent<LocalFrame> subframe = LocalFrame::create(frameLoaderClient.get(), document().frame()->host(), &iframe);
- subframe->setView(FrameView::create(subframe.get(), IntSize(500, 500)));
- subframe->init();
- static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(subframe.get());
- document().frame()->host()->incrementSubframeCount();
-
- Document& frameDocument = *iframe.contentDocument();
- frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://b.com/"));
- frameDocument.body()->setInnerHTML(
- absoluteBlockHtmlForLink(10, 10, 20, 20, "http://invisible.com")
+ Document& frameDocument = setupChildIframe("frame", absoluteBlockHtmlForLink(10, 10, 20, 20, "http://invisible.com")
+ absoluteBlockHtmlForLink(50, 60, 70, 80, "http://partly.visible.com")
+ absoluteBlockHtmlForLink(150, 160, 170, 180, "http://www.google.com")
+ absoluteBlockHtmlForLink(250, 260, 270, 280, "http://www.google.com#fragment")
- + absoluteBlockHtmlForLink(850, 860, 70, 80, "http://another.invisible.com"),
- ASSERT_NO_EXCEPTION);
- iframe.contentWindow()->scrollTo(100, 100);
+ + absoluteBlockHtmlForLink(850, 860, 70, 80, "http://another.invisible.com"));
+
+ frameDocument.domWindow()->scrollTo(100, 100);
printSinglePage(canvas);
@@ -341,10 +313,6 @@ TEST_F(PrintContextFrameTest, WithScrolledSubframe)
EXPECT_SKRECT_EQ(150, 160, 170, 180, operations[1].rect);
EXPECT_EQ(MockCanvas::DrawRect, operations[2].type);
EXPECT_SKRECT_EQ(250, 260, 270, 280, operations[2].rect);
-
- subframe->detach(FrameDetachType::Remove);
- static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(nullptr);
- document().frame()->host()->decrementSubframeCount();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698