summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-06-26 14:35:00 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-07-01 10:11:53 +0200
commita745da3d657760fa54995331882dcfff29a31b9f (patch)
treeb48a62b1c1e272aa0a87e85096d1ef4a4a3423ff /tests
parent0058d5b9dd56ba0453be3297231484917441f7f7 (diff)
XFAIL tst_QWebEngineFrame::setUrlHistory
Update the checks to cover the case where the count could be the same with different URLs, and mark those checks as currently failing because QtWebEngine doesn't have the logic preventing QUrl() to affect the history. Change-Id: Id0260d21d32d9e85fbd14f44536c2c93b6eb40b1 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
index 89c783245..3846e50c9 100644
--- a/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
+++ b/tests/auto/widgets/qwebengineframe/tst_qwebengineframe.cpp
@@ -1353,6 +1353,14 @@ void tst_QWebEngineFrame::setUrlToInvalid()
QCOMPARE(baseUrlSync(&page), aboutBlank);
}
+static QStringList collectHistoryUrls(QWebEngineHistory *history)
+{
+ QStringList urls;
+ foreach (const QWebEngineHistoryItem &i, history->items())
+ urls << i.url().toString();
+ return urls;
+}
+
void tst_QWebEngineFrame::setUrlHistory()
{
const QUrl aboutBlank("about:blank");
@@ -1368,7 +1376,7 @@ void tst_QWebEngineFrame::setUrlHistory()
QEXPECT_FAIL("", "Slight change: QUrl() isn't replaced by about:blank.", Continue);
QCOMPARE(m_page->url(), aboutBlank);
QCOMPARE(m_page->requestedUrl(), QUrl());
- QCOMPARE(m_page->history()->count(), 0);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList());
url = QUrl("http://non.existent/");
m_page->setUrl(url);
@@ -1376,7 +1384,7 @@ void tst_QWebEngineFrame::setUrlHistory()
QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
- QCOMPARE(m_page->history()->count(), 0);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList());
url = QUrl("qrc:/test1.html");
m_page->setUrl(url);
@@ -1384,7 +1392,7 @@ void tst_QWebEngineFrame::setUrlHistory()
QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
- QCOMPARE(m_page->history()->count(), 1);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList() << QStringLiteral("qrc:/test1.html"));
m_page->setUrl(QUrl());
expectedLoadFinishedCount++;
@@ -1392,7 +1400,8 @@ void tst_QWebEngineFrame::setUrlHistory()
QCOMPARE(m_page->url(), aboutBlank);
QEXPECT_FAIL("", "Slight change: This information now comes from Chromium and the behavior of requestedUrl changed in this case.", Continue);
QCOMPARE(m_page->requestedUrl(), QUrl());
- QCOMPARE(m_page->history()->count(), 1);
+ QEXPECT_FAIL("", "Slight change: load(QUrl()) currently loads about:blank and nothing prevents it from being added to the history.", Continue);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList() << QStringLiteral("qrc:/test1.html"));
// Loading same page as current in history, so history count doesn't change.
url = QUrl("qrc:/test1.html");
@@ -1401,7 +1410,8 @@ void tst_QWebEngineFrame::setUrlHistory()
QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
- QCOMPARE(m_page->history()->count(), 1);
+ QEXPECT_FAIL("", "Slight change: load(QUrl()) currently loads about:blank and nothing prevents it from being added to the history.", Continue);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList() << QStringLiteral("qrc:/test1.html"));
url = QUrl("qrc:/test2.html");
m_page->setUrl(url);
@@ -1409,7 +1419,8 @@ void tst_QWebEngineFrame::setUrlHistory()
QTRY_COMPARE(spy.count(), expectedLoadFinishedCount);
QCOMPARE(m_page->url(), url);
QCOMPARE(m_page->requestedUrl(), url);
- QCOMPARE(m_page->history()->count(), 2);
+ QEXPECT_FAIL("", "Slight change: load(QUrl()) currently loads about:blank and nothing prevents it from being added to the history.", Continue);
+ QCOMPARE(collectHistoryUrls(m_page->history()), QStringList() << QStringLiteral("qrc:/test1.html") << QStringLiteral("qrc:/test2.html"));
}
void tst_QWebEngineFrame::setUrlUsingStateObject()