| Index: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| index b130bbb2bc29c5bee5569ef7d337b494aa17293b..391c484e9041bf9fabd9f7923fb2841bc654f31b 100644
|
| --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| @@ -15,6 +15,7 @@
|
| #include "core/layout/LayoutObject.h"
|
| #include "core/layout/api/LayoutViewItem.h"
|
| #include "core/layout/compositing/PaintLayerCompositor.h"
|
| +#include "core/loader/DocumentLoader.h"
|
| #include "core/page/Page.h"
|
| #include "core/paint/PaintLayer.h"
|
| #include "platform/geometry/DoublePoint.h"
|
| @@ -877,7 +878,8 @@ TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
|
| EXPECT_SIZE_EQ(ScrollOffset(0, 0),
|
| toLocalFrame(webViewImpl()->page()->mainFrame())
|
| ->loader()
|
| - .currentItem()
|
| + .documentLoader()
|
| + ->historyItem()
|
| ->visualViewportScrollOffset());
|
|
|
| VisualViewport& visualViewport = frame()->page()->visualViewport();
|
| @@ -885,7 +887,8 @@ TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
|
|
|
| EXPECT_EQ(2, toLocalFrame(webViewImpl()->page()->mainFrame())
|
| ->loader()
|
| - .currentItem()
|
| + .documentLoader()
|
| + ->historyItem()
|
| ->pageScaleFactor());
|
|
|
| visualViewport.setLocation(FloatPoint(10, 20));
|
| @@ -893,7 +896,8 @@ TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
|
| EXPECT_SIZE_EQ(ScrollOffset(10, 20),
|
| toLocalFrame(webViewImpl()->page()->mainFrame())
|
| ->loader()
|
| - .currentItem()
|
| + .documentLoader()
|
| + ->historyItem()
|
| ->visualViewportScrollOffset());
|
| }
|
|
|
| @@ -976,8 +980,12 @@ TEST_P(VisualViewportTest,
|
| visualViewport.setScale(2);
|
| visualViewport.setLocation(FloatPoint(350, 350));
|
|
|
| - Persistent<HistoryItem> firstItem =
|
| - webViewImpl()->mainFrameImpl()->frame()->loader().currentItem();
|
| + Persistent<HistoryItem> firstItem = webViewImpl()
|
| + ->mainFrameImpl()
|
| + ->frame()
|
| + ->loader()
|
| + .documentLoader()
|
| + ->historyItem();
|
| EXPECT_SIZE_EQ(ScrollOffset(0, 1000), firstItem->getScrollOffset());
|
|
|
| // Now navigate to a page which causes a smaller frameView. Make sure that
|
| @@ -986,8 +994,12 @@ TEST_P(VisualViewportTest,
|
| navigateTo("about:blank");
|
| frameView = webViewImpl()->mainFrameImpl()->frameView();
|
|
|
| - EXPECT_NE(firstItem,
|
| - webViewImpl()->mainFrameImpl()->frame()->loader().currentItem());
|
| + EXPECT_NE(firstItem, webViewImpl()
|
| + ->mainFrameImpl()
|
| + ->frame()
|
| + ->loader()
|
| + .documentLoader()
|
| + ->historyItem());
|
| EXPECT_LT(frameView->frameRect().size().width(), 1000);
|
| EXPECT_SIZE_EQ(ScrollOffset(0, 1000), firstItem->getScrollOffset());
|
| }
|
|
|