From 0feb0436f5d9a1adc401de837e25e523a03d2925 Mon Sep 17 00:00:00 2001 From: Peter Varga <pvarga@inf.u-szeged.hu> Date: Fri, 17 Mar 2017 09:35:25 +0100 Subject: [PATCH] Remove tst_QWebEnginePage::scrollToAnchor auto test The tested QWebEnginePage::scrollToAnchor API can't be added to QtWebEngine for now. Currently, Chromium Content API doesn't support to control page scroll. The corresponding feature can be used by URL fragment identifier (#anchor) or JavaScript API (location.href). Change-Id: Ie9c87758d458858ba677d309a548cdced525557b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> --- .../qwebenginepage/tst_qwebenginepage.cpp | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 231012c65..393902a9e 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -184,7 +184,6 @@ private Q_SLOTS: void baseUrl_data(); void baseUrl(); void scrollPosition(); - void scrollToAnchor(); void scrollbarsOff(); void evaluateWillCauseRepaint(); void setContent_data(); @@ -3514,42 +3513,6 @@ void tst_QWebEnginePage::scrollPosition() QCOMPARE(y, 29); } -void tst_QWebEnginePage::scrollToAnchor() -{ -#if !defined(QWEBENGINEELEMENT) - QSKIP("QWEBENGINEELEMENT"); -#else - QWebEnginePage page; - page.setViewportSize(QSize(480, 800)); - - QString html("<html><body><p style=\"margin-bottom: 1500px;\">Hello.</p>" - "<p><a id=\"foo\">This</a> is an anchor</p>" - "<p style=\"margin-bottom: 1500px;\"><a id=\"bar\">This</a> is another anchor</p>" - "</body></html>"); - page.setHtml(html); - page.setScrollPosition(QPoint(0, 0)); - QCOMPARE(page.scrollPosition().x(), 0); - QCOMPARE(page.scrollPosition().y(), 0); - - QWebEngineElement fooAnchor = page.findFirstElement("a[id=foo]"); - - page.scrollToAnchor("foo"); - QCOMPARE(page.scrollPosition().y(), fooAnchor.geometry().top()); - - page.scrollToAnchor("bar"); - page.scrollToAnchor("foo"); - QCOMPARE(page.scrollPosition().y(), fooAnchor.geometry().top()); - - page.scrollToAnchor("top"); - QCOMPARE(page.scrollPosition().y(), 0); - - page.scrollToAnchor("bar"); - page.scrollToAnchor("notexist"); - QVERIFY(page.scrollPosition().y() != 0); -#endif -} - - void tst_QWebEnginePage::scrollbarsOff() { #if !defined(QWEBENGINEPAGE_EVALUATEJAVASCRIPT) -- GitLab