diff options
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_userScripts.qml')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_userScripts.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml index 358e8f56d..92ae71f0b 100644 --- a/tests/auto/quick/qmltests/data/tst_userScripts.qml +++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml @@ -49,6 +49,11 @@ Item { injectionPoint: WebEngineScript.DocumentReady } + WebEngineScript { + id: scriptWithMetadata + sourceUrl: Qt.resolvedUrl("script-with-metadata.js") + } + TestWebEngineView { id: webEngineView width: 400 @@ -151,5 +156,22 @@ Item { webEngineView.waitForLoadSucceeded(); compare(webEngineView.title, "Big user script changed title"); } + + function test_parseMetadataHeader() { + compare(scriptWithMetadata.name, "Test script"); + compare(scriptWithMetadata.injectionPoint, WebEngineScript.DocumentReady); + + webEngineView.userScripts = [ scriptWithMetadata ]; + + // @include *test*.html + webEngineView.url = Qt.resolvedUrl("test1.html"); + webEngineView.waitForLoadSucceeded(); + compare(webEngineView.title, "New title"); + + // @exclude *test2.html + webEngineView.url = Qt.resolvedUrl("test2.html"); + webEngineView.waitForLoadSucceeded(); + compare(webEngineView.title, "Test page with huge link area"); + } } } |