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

Unified Diff: Source/web/tests/WebViewTest.cpp

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 | « Source/web/tests/WebInputEventConversionTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index e18e7ac52264779e7eb95c31326cc494d5030c05..147e727d866d57c903f597802c92073624ff520d 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -793,10 +793,11 @@ TEST_F(WebViewTest, HistoryResetScrollAndScaleState)
EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor());
EXPECT_EQ(116, webViewImpl->mainFrame()->scrollOffset().width);
EXPECT_EQ(84, webViewImpl->mainFrame()->scrollOffset().height);
- webViewImpl->page()->mainFrame()->loader().saveScrollState();
- EXPECT_EQ(2.0f, webViewImpl->page()->mainFrame()->loader().currentItem()->pageScaleFactor());
- EXPECT_EQ(116, webViewImpl->page()->mainFrame()->loader().currentItem()->scrollPoint().x());
- EXPECT_EQ(84, webViewImpl->page()->mainFrame()->loader().currentItem()->scrollPoint().y());
+ WebCore::LocalFrame* mainFrameLocal = toLocalFrame(webViewImpl->page()->mainFrame());
+ mainFrameLocal->loader().saveScrollState();
+ EXPECT_EQ(2.0f, mainFrameLocal->loader().currentItem()->pageScaleFactor());
+ EXPECT_EQ(116, mainFrameLocal->loader().currentItem()->scrollPoint().x());
+ EXPECT_EQ(84, mainFrameLocal->loader().currentItem()->scrollPoint().y());
// Confirm that resetting the page state resets the saved scroll position.
// The HistoryController treats a page scale factor of 0.0f as special and avoids
@@ -805,9 +806,9 @@ TEST_F(WebViewTest, HistoryResetScrollAndScaleState)
EXPECT_EQ(1.0f, webViewImpl->pageScaleFactor());
EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().width);
EXPECT_EQ(0, webViewImpl->mainFrame()->scrollOffset().height);
- EXPECT_EQ(0.0f, webViewImpl->page()->mainFrame()->loader().currentItem()->pageScaleFactor());
- EXPECT_EQ(0, webViewImpl->page()->mainFrame()->loader().currentItem()->scrollPoint().x());
- EXPECT_EQ(0, webViewImpl->page()->mainFrame()->loader().currentItem()->scrollPoint().y());
+ EXPECT_EQ(0.0f, mainFrameLocal->loader().currentItem()->pageScaleFactor());
+ EXPECT_EQ(0, mainFrameLocal->loader().currentItem()->scrollPoint().x());
+ EXPECT_EQ(0, mainFrameLocal->loader().currentItem()->scrollPoint().y());
}
class EnterFullscreenWebViewClient : public FrameTestHelpers::TestWebViewClient {
@@ -884,7 +885,7 @@ TEST_F(WebViewTest, PrintWithXHRInFlight)
URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("print_with_xhr_inflight.html"));
WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(m_baseURL + "print_with_xhr_inflight.html", true, 0, &client);
- ASSERT_EQ(WebCore::FrameStateComplete, webViewImpl->page()->mainFrame()->loader().state());
+ ASSERT_EQ(WebCore::FrameStateComplete, toLocalFrame(webViewImpl->page()->mainFrame())->loader().state());
EXPECT_TRUE(client.printCalled());
m_webViewHelper.reset();
}
@@ -1361,7 +1362,7 @@ TEST_F(WebViewTest, FocusExistingFrameOnNavigate)
WebURLRequest webURLRequest;
webURLRequest.initialize();
WebCore::FrameLoadRequest request(0, webURLRequest.toResourceRequest(), "_blank");
- webViewImpl->page()->mainFrame()->loader().load(request);
+ toLocalFrame(webViewImpl->page()->mainFrame())->loader().load(request);
ASSERT_TRUE(client.createdWebView());
EXPECT_FALSE(client.didFocusCalled());
@@ -1369,7 +1370,7 @@ TEST_F(WebViewTest, FocusExistingFrameOnNavigate)
WebURLRequest webURLRequestWithTargetStart;
webURLRequestWithTargetStart.initialize();
WebCore::FrameLoadRequest requestWithTargetStart(0, webURLRequestWithTargetStart.toResourceRequest(), "_start");
- toWebViewImpl(client.createdWebView())->page()->mainFrame()->loader().load(requestWithTargetStart);
+ toLocalFrame(toWebViewImpl(client.createdWebView())->page()->mainFrame())->loader().load(requestWithTargetStart);
EXPECT_TRUE(client.didFocusCalled());
m_webViewHelper.reset(); // Remove dependency on locally scoped client.
« no previous file with comments | « Source/web/tests/WebInputEventConversionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698