summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-11 17:18:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-11 18:34:14 +0200
commit6c2a111f8c82b56388abf409a61a3e0d56a52156 (patch)
tree0f5a7ad320f034233c065fc994980b10afe434ad /tests
parentc4fc323d0771e24ae726065cdce9eafef2c09c41 (diff)
parentd6e3ba85138a6147b9b34a1c3363b2d3b20ba284 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebenginepage/BLACKLIST6
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp18
2 files changed, 8 insertions, 16 deletions
diff --git a/tests/auto/widgets/qwebenginepage/BLACKLIST b/tests/auto/widgets/qwebenginepage/BLACKLIST
index b48e77a50..fcd36ba83 100644
--- a/tests/auto/widgets/qwebenginepage/BLACKLIST
+++ b/tests/auto/widgets/qwebenginepage/BLACKLIST
@@ -1,8 +1,2 @@
[macCopyUnicodeToClipboard]
osx
-
-[getUserMediaRequest]
-windows
-
-[setHtmlWithImageResource]
-*
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 8c9161790..dbaa63f86 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -3955,28 +3955,26 @@ void tst_QWebEnginePage::setHtml()
void tst_QWebEnginePage::setHtmlWithImageResource()
{
- // By default, only security origins of local files can load local resources.
- // So we should specify baseUrl to be a local file in order to get a proper origin and load the local image.
+ // We allow access to qrc resources from any security origin, including local and anonymous
QLatin1String html("<html><body><p>hello world</p><img src='qrc:/resources/image.png'/></body></html>");
QWebEnginePage page;
- page.setHtml(html, QUrl(QLatin1String("file:///path/to/file")));
- waitForSignal(&page, SIGNAL(loadFinished(bool)));
+ QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
+ page.setHtml(html, QUrl("file:///path/to/file"));
+ QTRY_COMPARE(spy.count(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images.length").toInt(), 1);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 128);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128);
- // Now we test the opposite: without a baseUrl as a local file, we cannot request local resources.
+ // Now we test the opposite: without a baseUrl as a local file, we can still request qrc resources.
page.setHtml(html);
- waitForSignal(&page, SIGNAL(loadFinished(bool)));
+ QTRY_COMPARE(spy.count(), 2);
QCOMPARE(evaluateJavaScriptSync(&page, "document.images.length").toInt(), 1);
- QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=118659", Continue);
- QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 0);
- QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=118659", Continue);
- QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 0);
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].width").toInt(), 128);
+ QCOMPARE(evaluateJavaScriptSync(&page, "document.images[0].height").toInt(), 128);
}
void tst_QWebEnginePage::setHtmlWithStylesheetResource()