diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2016-06-01 08:54:03 -0700 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2017-01-26 15:05:22 +0000 |
commit | e01dc0556f72da94e8a310959f3ad0471d063bcb (patch) | |
tree | f6e67b22e1d4ea7379408b326a8c8a80ff384a9a /tests/auto/quick/qmltests/data/tst_userScripts.qml | |
parent | 1981a3193f43e53c7c92f1057b8264153b1dab41 (diff) |
Add profile-wide user scripts to the Quick API
Add API tests in order to try how it works in C++ and QML.
Task-number: QTBUG-51034
Change-Id: I1680297e2dafba39dbd4b161f0dbdb14fb6d4243
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_userScripts.qml')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_userScripts.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_userScripts.qml b/tests/auto/quick/qmltests/data/tst_userScripts.qml index 88fa6f6e3..e9a4eba99 100644 --- a/tests/auto/quick/qmltests/data/tst_userScripts.qml +++ b/tests/auto/quick/qmltests/data/tst_userScripts.qml @@ -61,6 +61,12 @@ Item { } TestWebEngineView { + id: webEngineView2 + width: 400 + height: 300 + } + + TestWebEngineView { id: webEngineViewWithConditionalUserScripts width: 400 height: 300 @@ -82,6 +88,7 @@ Item { function init() { webEngineView.url = ""; webEngineView.userScripts = []; + webEngineView.profile.userScripts = []; } function test_oneScript() { @@ -173,5 +180,17 @@ Item { webEngineView.waitForLoadSucceeded(); tryCompare(webEngineView, "title", "Test page with huge link area"); } + + function test_profileWideScript() { + webEngineView.profile.userScripts = [ changeDocumentTitleScript ]; + + webEngineView.url = Qt.resolvedUrl("test1.html"); + webEngineView.waitForLoadSucceeded(); + compare(webEngineView.title, "New title"); + + webEngineView2.url = Qt.resolvedUrl("test1.html"); + webEngineView2.waitForLoadSucceeded(); + compare(webEngineView2.title, "New title"); + } } } |