summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-08-31 13:33:38 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-09-03 15:21:53 +0000
commitb5c9226856330772b239f4ca91fc252a55d0d83a (patch)
tree7624112f2bd23bfaa51abe5583d2fbcac795fcdf /tests
parentd85a349f4136554cfaa5349303270ad37b121941 (diff)
Fix selectAll on data url
SelectAll only works when there is a focused frame, so we must ensure a frame is focused when the web-contents requests focus. Change-Id: I00d670321b29342fcd447b4b07251df776019f1c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 4ed79e0c0..ba5366460 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -3120,13 +3120,16 @@ void tst_QWebEnginePage::testStopScheduledPageRefresh()
void tst_QWebEnginePage::findText()
{
- m_view->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>"));
-#if defined(QWEBENGINEPAGE_TRIGGERACTION_SELECTALL)
+ QSignalSpy loadSpy(m_page, SIGNAL(loadFinished(bool)));
+ m_page->setHtml(QString("<html><head></head><body><div>foo bar</div></body></html>"));
+ QTRY_COMPARE(loadSpy.count(), 1);
m_page->triggerAction(QWebEnginePage::SelectAll);
- QVERIFY(!m_page->selectedText().isEmpty());
+ QTRY_COMPARE(m_page->hasSelection(), true);
+#if defined(QWEBENGINEPAGE_SELECTEDHTML)
QVERIFY(!m_page->selectedHtml().isEmpty());
#endif
m_page->findText("");
+ QEXPECT_FAIL("", "Unsupported: findText only highlights and doesn't update the selection.", Continue);
QVERIFY(m_page->selectedText().isEmpty());
#if defined(QWEBENGINEPAGE_SELECTEDHTML)
QVERIFY(m_page->selectedHtml().isEmpty());
@@ -3140,6 +3143,7 @@ void tst_QWebEnginePage::findText()
QVERIFY(m_page->selectedHtml().contains(subString));
#endif
m_page->findText("");
+ QEXPECT_FAIL("", "Unsupported: findText only highlights and doesn't update the selection.", Continue);
QVERIFY(m_page->selectedText().isEmpty());
#if defined(QWEBENGINEPAGE_SELECTEDHTML)
QVERIFY(m_page->selectedHtml().isEmpty());