| Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
| index a727e0d3336aa7ce6e2bf73318e8f253dcfdafe0..45d8687867b21c55b2d6c42c07130152b994e69a 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
| @@ -3154,18 +3154,17 @@ TEST_P(WebViewTest, SmartClipData) {
|
| "10,000,000won</div>";
|
| WebString clipText;
|
| WebString clipHtml;
|
| - WebRect clipRect;
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("Ahem.ttf"));
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()),
|
| WebString::fromUTF8("smartclip.html"));
|
| - WebView* webView =
|
| + WebViewImpl* webView =
|
| m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip.html");
|
| webView->resize(WebSize(500, 500));
|
| webView->updateAllLifecyclePhases();
|
| WebRect cropRect(300, 125, 152, 50);
|
| - webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
|
| + webView->mainFrameImpl()->extractSmartClipData(cropRect, clipText, clipHtml);
|
| EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str());
|
| EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str());
|
| }
|
| @@ -3193,20 +3192,19 @@ TEST_P(WebViewTest, SmartClipDataWithPinchZoom) {
|
| "10,000,000won</div>";
|
| WebString clipText;
|
| WebString clipHtml;
|
| - WebRect clipRect;
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("Ahem.ttf"));
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()),
|
| WebString::fromUTF8("smartclip.html"));
|
| - WebView* webView =
|
| + WebViewImpl* webView =
|
| m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip.html");
|
| webView->resize(WebSize(500, 500));
|
| webView->updateAllLifecyclePhases();
|
| webView->setPageScaleFactor(1.5);
|
| webView->setVisualViewportOffset(WebFloatPoint(167, 100));
|
| WebRect cropRect(200, 38, 228, 75);
|
| - webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
|
| + webView->mainFrameImpl()->extractSmartClipData(cropRect, clipText, clipHtml);
|
| EXPECT_STREQ(kExpectedClipText, clipText.utf8().c_str());
|
| EXPECT_STREQ(kExpectedClipHtml, clipHtml.utf8().c_str());
|
| }
|
| @@ -3214,18 +3212,17 @@ TEST_P(WebViewTest, SmartClipDataWithPinchZoom) {
|
| TEST_P(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) {
|
| WebString clipText;
|
| WebString clipHtml;
|
| - WebRect clipRect;
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("Ahem.ttf"));
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()),
|
| WebString::fromUTF8("smartclip_user_select_none.html"));
|
| - WebView* webView = m_webViewHelper.initializeAndLoad(
|
| + WebViewImpl* webView = m_webViewHelper.initializeAndLoad(
|
| m_baseURL + "smartclip_user_select_none.html");
|
| webView->resize(WebSize(500, 500));
|
| webView->updateAllLifecyclePhases();
|
| WebRect cropRect(0, 0, 100, 100);
|
| - webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
|
| + webView->mainFrameImpl()->extractSmartClipData(cropRect, clipText, clipHtml);
|
| EXPECT_STREQ("", clipText.utf8().c_str());
|
| EXPECT_STREQ("", clipHtml.utf8().c_str());
|
| }
|
| @@ -3233,20 +3230,19 @@ TEST_P(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) {
|
| TEST_P(WebViewTest, SmartClipDoesNotCrashPositionReversed) {
|
| WebString clipText;
|
| WebString clipHtml;
|
| - WebRect clipRect;
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("Ahem.ttf"));
|
| URLTestHelpers::registerMockedURLFromBaseURL(
|
| WebString::fromUTF8(m_baseURL.c_str()),
|
| WebString::fromUTF8("smartclip_reversed_positions.html"));
|
| - WebView* webView = m_webViewHelper.initializeAndLoad(
|
| + WebViewImpl* webView = m_webViewHelper.initializeAndLoad(
|
| m_baseURL + "smartclip_reversed_positions.html");
|
| webView->resize(WebSize(500, 500));
|
| webView->updateAllLifecyclePhases();
|
| // Left upper corner of the rect will be end position in the DOM hierarchy.
|
| WebRect cropRect(30, 110, 400, 250);
|
| // This should not still crash. See crbug.com/589082 for more details.
|
| - webView->extractSmartClipData(cropRect, clipText, clipHtml, clipRect);
|
| + webView->mainFrameImpl()->extractSmartClipData(cropRect, clipText, clipHtml);
|
| }
|
|
|
| class CreateChildCounterFrameClient
|
|
|