summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2019-05-08 10:40:05 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2019-05-09 11:52:03 +0000
commita11bb985ab531fe570e6fb3d13c6e76a547b8178 (patch)
treefee44e747b303fa718704f55f0d70bf4b6d7e031 /tests
parentefee223d7ff6e0e30fb9d9dff1536936922d4a03 (diff)
Update docs and test for runJavaScript
Fixes: QTBUG-69567 Change-Id: Icdf5a200f7be1eb7a98cce62848e3a641c49e804 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 8c3b4002c..098bae9de 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -2806,6 +2806,18 @@ void tst_QWebEnginePage::runJavaScript()
JavaScriptCallbackUndefined callbackUndefined;
page.runJavaScript("undefined", QWebEngineCallback<const QVariant&>(callbackUndefined));
+ JavaScriptCallback callbackDate(QVariant(42.0));
+ page.runJavaScript("new Date(42000)", QWebEngineCallback<const QVariant&>(callbackDate));
+
+ JavaScriptCallback callbackBlob(QVariant(QByteArray(8, 0)));
+ page.runJavaScript("new ArrayBuffer(8)", QWebEngineCallback<const QVariant&>(callbackBlob));
+
+ JavaScriptCallbackUndefined callbackFunction;
+ page.runJavaScript("(function(){})", QWebEngineCallback<const QVariant&>(callbackFunction));
+
+ JavaScriptCallback callbackPromise(QVariant(QVariantMap{}));
+ page.runJavaScript("new Promise(function(){})", QWebEngineCallback<const QVariant&>(callbackPromise));
+
QVERIFY(watcher.wait());
}