summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 4cb8e23e5..bea44f73c 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -105,6 +105,7 @@ private Q_SLOTS:
void updatePositionDependentActionsCrash();
void createPluginWithPluginsEnabled();
void createPluginWithPluginsDisabled();
+ void callbackSpyDeleted();
void destroyPlugin_data();
void destroyPlugin();
void createViewlessPlugin_data();
@@ -441,6 +442,22 @@ static QImage imageWithoutAlpha(const QImage &image)
return result;
}
+void tst_QWebEnginePage::callbackSpyDeleted()
+{
+ QWebEnginePage *page = m_view->page();
+ CallbackSpy<QVariant> spy;
+ QString poorManSleep("function wait(ms){"
+ " var start = new Date().getTime();"
+ " var end = start;"
+ " while (start + ms > end) {"
+ "end = new Date().getTime();"
+ " }"
+ "}"
+ "wait(1000);");
+ page->runJavaScript(poorManSleep, spy.ref());
+ //spy deleted before callback
+}
+
void tst_QWebEnginePage::pasteImage()
{
// Pixels with an alpha value of 0 will have different RGB values after the