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

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

Issue 2667283007: Refactor Samsung SmartClip implementation. (Closed)
Patch Set: Really apply code review comments Created 3 years, 10 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 | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58a75966423ff4aff7f230279fa15dc416a54ba3..dbaf45ca5ac3fc3b8d706eb463e9de1d3b5b674d 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -3049,15 +3049,14 @@ TEST_P(WebViewTest, SmartClipData) {
"10,000,000won</div>";
WebString clipText;
WebString clipHtml;
- WebRect clipRect;
registerMockedHttpURLLoad("Ahem.ttf");
registerMockedHttpURLLoad("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());
}
@@ -3085,17 +3084,16 @@ TEST_P(WebViewTest, SmartClipDataWithPinchZoom) {
"10,000,000won</div>";
WebString clipText;
WebString clipHtml;
- WebRect clipRect;
registerMockedHttpURLLoad("Ahem.ttf");
registerMockedHttpURLLoad("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());
}
@@ -3103,15 +3101,14 @@ TEST_P(WebViewTest, SmartClipDataWithPinchZoom) {
TEST_P(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) {
WebString clipText;
WebString clipHtml;
- WebRect clipRect;
registerMockedHttpURLLoad("Ahem.ttf");
registerMockedHttpURLLoad("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());
}
@@ -3119,17 +3116,16 @@ TEST_P(WebViewTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) {
TEST_P(WebViewTest, SmartClipDoesNotCrashPositionReversed) {
WebString clipText;
WebString clipHtml;
- WebRect clipRect;
registerMockedHttpURLLoad("Ahem.ttf");
registerMockedHttpURLLoad("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
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698