| Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| index 0651c10139c5e73148a425565337cce38caaf789..968cc763f821af535c1972c7b9b1a811a9b88669 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -3195,7 +3195,7 @@ TEST_P(ParameterizedWebFrameTest, CharacterIndexAtPointWithPinchZoom)
|
| WebRect baseRect;
|
| WebRect extentRect;
|
|
|
| - WebFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame();
|
| + WebLocalFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame()->toWebLocalFrame();
|
| size_t ix = mainFrame->characterIndexForPoint(WebPoint(320, 388));
|
|
|
| EXPECT_EQ(2ul, ix);
|
| @@ -3209,7 +3209,7 @@ TEST_P(ParameterizedWebFrameTest, FirstRectForCharacterRangeWithPinchZoom)
|
| webViewHelper.initializeAndLoad(m_baseURL + "textbox.html", true);
|
| webViewHelper.resize(WebSize(640, 480));
|
|
|
| - WebFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame();
|
| + WebLocalFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame()->toWebLocalFrame();
|
| mainFrame->executeScript(WebScriptSource("selectRange();"));
|
|
|
| WebRect oldRect;
|
| @@ -3688,7 +3688,7 @@ TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage)
|
| {
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| webViewHelper.initializeAndLoad("about:blank", true);
|
| - WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| + WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
|
|
| // Generate a simple test case.
|
| const char simpleSource[] = "<p>Hello</p><p>World</p>";
|
| @@ -3698,12 +3698,12 @@ TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage)
|
| WebString text = WebFrameContentDumper::dumpWebViewAsText(webViewHelper.webView(), std::numeric_limits<size_t>::max());
|
| EXPECT_EQ("Hello\n\nWorld", text.utf8());
|
|
|
| - const std::string html = WebFrameContentDumper::dumpAsMarkup(frame->toWebLocalFrame()).utf8();
|
| + const std::string html = WebFrameContentDumper::dumpAsMarkup(frame).utf8();
|
|
|
| // Load again with the output html.
|
| FrameTestHelpers::loadHTMLString(frame, html, testURL);
|
|
|
| - EXPECT_EQ(html, WebFrameContentDumper::dumpAsMarkup(frame->toWebLocalFrame()).utf8());
|
| + EXPECT_EQ(html, WebFrameContentDumper::dumpAsMarkup(frame).utf8());
|
|
|
| text = WebFrameContentDumper::dumpWebViewAsText(webViewHelper.webView(), std::numeric_limits<size_t>::max());
|
| EXPECT_EQ("Hello\n\nWorld", text.utf8());
|
| @@ -4151,12 +4151,12 @@ static WebRect elementBounds(WebFrame* frame, const WebString& id)
|
|
|
| static std::string selectionAsString(WebFrame* frame)
|
| {
|
| - return frame->selectionAsText().utf8();
|
| + return frame->toWebLocalFrame()->selectionAsText().utf8();
|
| }
|
|
|
| TEST_P(ParameterizedWebFrameTest, SelectRange)
|
| {
|
| - WebFrame* frame;
|
| + WebLocalFrame* frame;
|
| WebRect startWebRect;
|
| WebRect endWebRect;
|
|
|
| @@ -4165,7 +4165,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange)
|
|
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "select_range_basic.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| EXPECT_EQ("Some test text for testing.", selectionAsString(frame));
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
| frame->executeCommand(WebString::fromUTF8("Unselect"));
|
| @@ -4177,7 +4177,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange)
|
| || selectionString == "Some test text for testing");
|
|
|
| initializeTextSelectionWebView(m_baseURL + "select_range_scroll.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame));
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
| frame->executeCommand(WebString::fromUTF8("Unselect"));
|
| @@ -4201,7 +4201,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeInIframe)
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "select_range_iframe.html", &webViewHelper);
|
| frame = webViewHelper.webView()->mainFrame();
|
| - WebFrame* subframe = frame->firstChild();
|
| + WebLocalFrame* subframe = frame->firstChild()->toWebLocalFrame();
|
| EXPECT_EQ("Some test text for testing.", selectionAsString(subframe));
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
| subframe->executeCommand(WebString::fromUTF8("Unselect"));
|
| @@ -4215,7 +4215,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeInIframe)
|
|
|
| TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
|
| {
|
| - WebFrame* frame;
|
| + WebLocalFrame* frame;
|
| WebRect startWebRect;
|
| WebRect endWebRect;
|
|
|
| @@ -4225,7 +4225,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
|
| // The selection range should be clipped to the bounds of the editable element.
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
|
|
| @@ -4234,7 +4234,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
|
|
|
| // As above, but extending the selection to the bottom of the document.
|
| initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
|
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
| frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
|
| @@ -4250,7 +4250,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
|
| // http://crbug.com/238334.
|
| TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable)
|
| {
|
| - WebFrame* frame;
|
| + WebLocalFrame* frame;
|
| WebRect startWebRect;
|
| WebRect endWebRect;
|
|
|
| @@ -4260,7 +4260,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable)
|
| // The selection range should be clipped to the bounds of the editable element.
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
|
|
| @@ -4269,7 +4269,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable)
|
|
|
| // As above, but extending the selection to the bottom of the document.
|
| initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html", &webViewHelper);
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
|
|
| webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
|
| frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
|
| @@ -4287,7 +4287,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionStart)
|
| registerMockedHttpURLLoad("text_selection.html");
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "text_selection.html", &webViewHelper);
|
| - WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| + WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
|
|
| // Select second span. We can move the start to include the first span.
|
| frame->executeScript(WebScriptSource("selectElement('header_2');"));
|
| @@ -4335,7 +4335,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionEnd)
|
| registerMockedHttpURLLoad("text_selection.html");
|
| FrameTestHelpers::WebViewHelper webViewHelper(this);
|
| initializeTextSelectionWebView(m_baseURL + "text_selection.html", &webViewHelper);
|
| - WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| + WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
|
|
| // Select first span. We can move the end to include the second span.
|
| frame->executeScript(WebScriptSource("selectElement('header_1');"));
|
| @@ -4737,7 +4737,7 @@ TEST_P(ParameterizedWebFrameTest, CompositedSelectionBoundsCleared)
|
| FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "select_range_basic.html");
|
|
|
| // The frame starts with no selection.
|
| - WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| + WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| ASSERT_TRUE(frame->hasSelection());
|
| EXPECT_TRUE(fakeSelectionLayerTreeView.getAndResetSelectionCleared());
|
|
|
| @@ -4768,7 +4768,7 @@ TEST_P(ParameterizedWebFrameTest, CompositedSelectionBoundsCleared)
|
| ASSERT_TRUE(frame->hasSelection());
|
| EXPECT_FALSE(fakeSelectionLayerTreeView.getAndResetSelectionCleared());
|
|
|
| - frame = webViewHelper.webView()->mainFrame();
|
| + frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
|
| frame->executeCommand(WebString::fromUTF8("Unselect"));
|
| webViewHelper.webView()->updateAllLifecyclePhases();
|
| ASSERT_FALSE(frame->hasSelection());
|
| @@ -5166,7 +5166,7 @@ TEST_P(ParameterizedWebFrameTest, MoveCaretSelectionTowardsWindowPointWithNoSele
|
| WebFrame* frame = webViewHelper.webView()->mainFrame();
|
|
|
| // This test passes if this doesn't crash.
|
| - frame->moveCaretSelection(WebPoint(0, 0));
|
| + frame->toWebLocalFrame()->moveCaretSelection(WebPoint(0, 0));
|
| }
|
|
|
| class SpellCheckClient : public WebSpellCheckClient {
|
|
|