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

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

Issue 2710983003: Move HistoryItem handling to DocumentLoader (Closed)
Patch Set: Address kinuko's comments Created 3 years, 9 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
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 0a06097b68e304863759dfb958ab4e001336fdb2..d08b52bc0deda7dbcadede48f0073fb636a3f52d 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -14,6 +14,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"
@@ -876,7 +877,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();
@@ -884,7 +886,8 @@ TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
EXPECT_EQ(2, toLocalFrame(webViewImpl()->page()->mainFrame())
->loader()
- .currentItem()
+ .documentLoader()
+ ->historyItem()
->pageScaleFactor());
visualViewport.setLocation(FloatPoint(10, 20));
@@ -892,7 +895,8 @@ TEST_P(VisualViewportTest, TestSavedToHistoryItem) {
EXPECT_SIZE_EQ(ScrollOffset(10, 20),
toLocalFrame(webViewImpl()->page()->mainFrame())
->loader()
- .currentItem()
+ .documentLoader()
+ ->historyItem()
->visualViewportScrollOffset());
}
@@ -975,8 +979,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
@@ -985,8 +993,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());
}
« no previous file with comments | « third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698