summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_userScripts.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_userScripts.qml')
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml
index d7c7d5983..f4fcc30ab 100644
--- a/tests/auto/quick/qmltests/data/tst_userScripts.qml
+++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml
@@ -54,6 +54,11 @@ Item {
sourceUrl: Qt.resolvedUrl("script-with-metadata.js")
}
+ WebEngineScript {
+ id: scriptWithBadMatchMetadata
+ sourceUrl: Qt.resolvedUrl("script-with-bad-match-metadata.js")
+ }
+
TestWebEngineView {
id: webEngineView
width: 400
@@ -191,6 +196,18 @@ Item {
tryCompare(webEngineView, "title", "Test page with huge link area and iframe");
}
+ function test_dontInjectBadUrlPatternsEverywhere() {
+ compare(scriptWithBadMatchMetadata.name, "Test bad match script");
+ compare(scriptWithBadMatchMetadata.injectionPoint, WebEngineScript.DocumentReady);
+
+ webEngineView.userScripts = [ scriptWithBadMatchMetadata ];
+
+ // @match some:junk
+ webEngineView.url = Qt.resolvedUrl("test2.html");
+ webEngineView.waitForLoadSucceeded();
+ tryCompare(webEngineView, "title", "Test page with huge link area");
+ }
+
function test_profileWideScript() {
webEngineView.profile.userScripts = [ changeDocumentTitleScript ];