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

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

Issue 23671002: Refactoring: Add toWebFrameImpl() interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected as per review commments. Created 7 years, 4 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/RenderTableRowTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 3ebaed81af6d3a1ae437d36ed36b99f831c19753..37d4f7efab0f4638a0e830bf2ac87dbef1ef4ed7 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2080,7 +2080,7 @@ TEST_F(WebFrameTest, FindInPageMatchRects)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
mainFrame->resetMatchCount();
@@ -2199,7 +2199,7 @@ TEST_F(WebFrameTest, FindInPageSkipsHiddenFrames)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
mainFrame->resetMatchCount();
@@ -2231,8 +2231,8 @@ TEST_F(WebFrameTest, FindOnDetachedFrame)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
- WebFrameImpl* secondFrame = static_cast<WebFrameImpl*>(mainFrame->traverseNext(false));
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
+ WebFrameImpl* secondFrame = toWebFrameImpl(mainFrame->traverseNext(false));
RefPtr<WebCore::Frame> holdSecondFrame = secondFrame->frame();
// Detach the frame before finding.
@@ -2274,8 +2274,8 @@ TEST_F(WebFrameTest, FindDetachFrameBeforeScopeStrings)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
- WebFrameImpl* secondFrame = static_cast<WebFrameImpl*>(mainFrame->traverseNext(false));
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
+ WebFrameImpl* secondFrame = toWebFrameImpl(mainFrame->traverseNext(false));
RefPtr<WebCore::Frame> holdSecondFrame = secondFrame->frame();
for (WebFrame* frame = mainFrame; frame; frame = frame->traverseNext(false))
@@ -2317,8 +2317,8 @@ TEST_F(WebFrameTest, FindDetachFrameWhileScopingStrings)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
- WebFrameImpl* secondFrame = static_cast<WebFrameImpl*>(mainFrame->traverseNext(false));
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
+ WebFrameImpl* secondFrame = toWebFrameImpl(mainFrame->traverseNext(false));
RefPtr<WebCore::Frame> holdSecondFrame = secondFrame->frame();
for (WebFrame* frame = mainFrame; frame; frame = frame->traverseNext(false))
@@ -2611,14 +2611,14 @@ TEST_F(WebFrameTest, DISABLED_PositionForPointTest)
{
registerMockedHttpURLLoad("select_range_span_editable.html");
m_webView = createWebViewForTextSelection(m_baseURL + "select_range_span_editable.html");
- WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* mainFrame = toWebFrameImpl(m_webView->mainFrame());
WebCore::RenderObject* renderer = mainFrame->frame()->selection()->rootEditableElement()->renderer();
EXPECT_EQ(0, computeOffset(renderer, -1, -1));
EXPECT_EQ(64, computeOffset(renderer, 1000, 1000));
registerMockedHttpURLLoad("select_range_div_editable.html");
m_webView = createWebViewForTextSelection(m_baseURL + "select_range_div_editable.html");
- mainFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ mainFrame = toWebFrameImpl(m_webView->mainFrame());
renderer = mainFrame->frame()->selection()->rootEditableElement()->renderer();
EXPECT_EQ(0, computeOffset(renderer, -1, -1));
EXPECT_EQ(64, computeOffset(renderer, 1000, 1000));
@@ -3050,7 +3050,7 @@ TEST_F(WebFrameTest, ReplaceMisspelledRange)
SpellCheckClient spellcheck;
m_webView->setSpellCheckClient(&spellcheck);
- WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* frame = toWebFrameImpl(m_webView->mainFrame());
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -3083,7 +3083,7 @@ TEST_F(WebFrameTest, RemoveSpellingMarkers)
SpellCheckClient spellcheck;
m_webView->setSpellCheckClient(&spellcheck);
- WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* frame = toWebFrameImpl(m_webView->mainFrame());
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -3115,7 +3115,7 @@ TEST_F(WebFrameTest, MarkerHashIdentifiers) {
SpellCheckClient spellcheck(kHash);
m_webView->setSpellCheckClient(&spellcheck);
- WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* frame = toWebFrameImpl(m_webView->mainFrame());
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -3173,7 +3173,7 @@ TEST_F(WebFrameTest, SlowSpellcheckMarkerPosition)
StubbornSpellCheckClient spellcheck;
m_webView->setSpellCheckClient(&spellcheck);
- WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* frame = toWebFrameImpl(m_webView->mainFrame());
WebInputElement webInputElement = frame->document().getElementById("data").to<WebInputElement>();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -3205,7 +3205,7 @@ TEST_F(WebFrameTest, CancelSpellingRequestCrash)
m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "spell.html");
m_webView->setSpellCheckClient(0);
- WebFrameImpl* frame = static_cast<WebFrameImpl*>(m_webView->mainFrame());
+ WebFrameImpl* frame = toWebFrameImpl(m_webView->mainFrame());
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -3323,7 +3323,7 @@ public:
if (frame->parent())
return;
EXPECT_FALSE(m_didScrollMainFrame);
- WebCore::FrameView* view = static_cast<WebFrameImpl*>(frame)->frameView();
+ WebCore::FrameView* view = toWebFrameImpl(frame)->frameView();
// FrameView can be scrolled in FrameView::setFixedVisibleContentRect
// which is called from Frame::createView (before the frame is associated
// with the the view).
@@ -3508,7 +3508,7 @@ public:
virtual void willSendRequest(WebFrame* frame, unsigned, WebURLRequest&, const WebURLResponse&)
{
- if (static_cast<WebFrameImpl*>(frame)->frame()->loader()->loadType() == WebCore::FrameLoadTypeSame)
+ if (toWebFrameImpl(frame)->frame()->loader()->loadType() == WebCore::FrameLoadTypeSame)
m_frameLoadTypeSameSeen = true;
}
« no previous file with comments | « Source/web/tests/RenderTableRowTest.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698