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

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

Issue 781743002: Deleted unused code about WebViewImpl::getSelectionRootBounds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/WebViewImpl.cpp ('k') | Source/web/tests/data/select_range_basic_broken_height.html » ('j') | 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 fb8cd7bc52ffb529c1ff96299d4b415deb33af0b..bff66305178a63d8bc46f6654a157cf2cd0663a7 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -1950,87 +1950,14 @@ void WebViewTest::testSelectionRootBounds(const char* htmlFile, float pageScaleF
EXPECT_TRUE(frame->frame()->document()->isHTMLDocument());
HTMLDocument* document = toHTMLDocument(frame->frame()->document());
- WebRect expectedRootBounds = ExpectedRootBounds(document, webView->pageScaleFactor());
- WebRect actualRootBounds;
- webView->getSelectionRootBounds(actualRootBounds);
- ASSERT_EQ(expectedRootBounds, actualRootBounds);
-
WebRect anchor, focus;
webView->selectionBounds(anchor, focus);
- IntRect expectedIntRect = expectedRootBounds;
+ IntRect expectedIntRect = ExpectedRootBounds(document, webView->pageScaleFactor());
ASSERT_TRUE(expectedIntRect.contains(anchor));
// The "overflow" tests have the focus boundary outside of the element box.
ASSERT_EQ(url.find("overflow") == std::string::npos, expectedIntRect.contains(focus));
}
-TEST_F(WebViewTest, GetSelectionRootBounds)
-{
- // Register all the pages we will be using.
- registerMockedHttpURLLoad("select_range_basic.html");
- registerMockedHttpURLLoad("select_range_div_editable.html");
- registerMockedHttpURLLoad("select_range_scroll.html");
- registerMockedHttpURLLoad("select_range_span_editable.html");
- registerMockedHttpURLLoad("select_range_input.html");
- registerMockedHttpURLLoad("select_range_input_overflow.html");
- registerMockedHttpURLLoad("select_range_textarea.html");
- registerMockedHttpURLLoad("select_range_textarea_overflow.html");
- registerMockedHttpURLLoad("select_range_iframe.html");
- registerMockedHttpURLLoad("select_range_iframe_div_editable.html");
- registerMockedHttpURLLoad("select_range_iframe_scroll.html");
- registerMockedHttpURLLoad("select_range_iframe_span_editable.html");
- registerMockedHttpURLLoad("select_range_iframe_input.html");
- registerMockedHttpURLLoad("select_range_iframe_input_overflow.html");
- registerMockedHttpURLLoad("select_range_iframe_textarea.html");
- registerMockedHttpURLLoad("select_range_iframe_textarea_overflow.html");
-
- // Test with simple pages.
- testSelectionRootBounds("select_range_basic.html", 1.0f);
- testSelectionRootBounds("select_range_div_editable.html", 1.0f);
- testSelectionRootBounds("select_range_scroll.html", 1.0f);
- testSelectionRootBounds("select_range_span_editable.html", 1.0f);
- testSelectionRootBounds("select_range_input.html", 1.0f);
- testSelectionRootBounds("select_range_input_overflow.html", 1.0f);
- testSelectionRootBounds("select_range_textarea.html", 1.0f);
- testSelectionRootBounds("select_range_textarea_overflow.html", 1.0f);
-
- // Test with the same pages as above in iframes.
- testSelectionRootBounds("select_range_iframe.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_div_editable.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_scroll.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_span_editable.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_input.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_input_overflow.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_textarea.html", 1.0f);
- testSelectionRootBounds("select_range_iframe_textarea_overflow.html", 1.0f);
-
- // Basic page with scale factor.
- testSelectionRootBounds("select_range_basic.html", 0.0f);
- testSelectionRootBounds("select_range_basic.html", 0.1f);
- testSelectionRootBounds("select_range_basic.html", 1.5f);
- testSelectionRootBounds("select_range_basic.html", 2.0f);
-}
-
-TEST_F(WebViewTest, GetSelectionRootBoundsBrokenHeight)
-{
- WebSize contentSize = WebSize(640, 480);
-
- registerMockedHttpURLLoad("select_range_basic_broken_height.html");
-
- WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "select_range_basic_broken_height.html", true);
- webView->resize(contentSize);
- webView->setPageScaleFactor(1.0f, WebPoint(0, 0));
- webView->layout();
- runPendingTasks();
-
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
- EXPECT_TRUE(frame->frame()->document()->isHTMLDocument());
-
- WebRect expectedRootBounds = WebRect(0, 0, contentSize.width, contentSize.height);
- WebRect actualRootBounds;
- webView->getSelectionRootBounds(actualRootBounds);
- ASSERT_EQ(expectedRootBounds, actualRootBounds);
-}
-
class NonUserInputTextUpdateWebViewClient : public FrameTestHelpers::TestWebViewClient {
public:
NonUserInputTextUpdateWebViewClient() : m_textIsUpdated(false) { }
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/select_range_basic_broken_height.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698