summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/ApplicationRoot.qml
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2015-03-30 05:58:20 -0700
committerSzabolcs David <davidsz@inf.u-szeged.hu>2015-05-07 12:23:13 +0000
commit76a990cfa3409214530e77d132cdefd9e96685f9 (patch)
tree7d62ab06ba35446d0ba56a30fe6d3e93362a7cc6 /tests/quicktestbrowser/ApplicationRoot.qml
parent8596813a10b66b539746bb890bd4304e5f65b348 (diff)
Quick: Share profiles between application windows
The applications should not create new WebEngineProfiles for each window, because the WebEngineView can not adopt content from a different profile when the target of the NewViewRequest is a new window (SHIFT+click) or a dialog. This also adds a notifier signal to the profile property in order to avoid "non-NOTIFYable" warnings. Change-Id: I235789f9bfa1a216f99592204e50266242d0ef1c Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests/quicktestbrowser/ApplicationRoot.qml')
-rw-r--r--tests/quicktestbrowser/ApplicationRoot.qml25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/quicktestbrowser/ApplicationRoot.qml b/tests/quicktestbrowser/ApplicationRoot.qml
index b16ee0078..71737694d 100644
--- a/tests/quicktestbrowser/ApplicationRoot.qml
+++ b/tests/quicktestbrowser/ApplicationRoot.qml
@@ -39,9 +39,19 @@
****************************************************************************/
import QtQuick 2.1
+import QtWebEngine 1.1
QtObject {
id: root
+
+ property QtObject testProfile: WebEngineProfile {
+ storageName: "Test"
+ }
+
+ property QtObject otrProfile: WebEngineProfile {
+ offTheRecord: true
+ }
+
property Component browserWindowComponent: BrowserWindow {
applicationRoot: root
onClosing: destroy()
@@ -49,10 +59,19 @@ QtObject {
property Component browserDialogComponent: BrowserDialog {
onClosing: destroy()
}
- function createWindow() { return browserWindowComponent.createObject(root) }
- function createDialog() { return browserDialogComponent.createObject(root) }
+ function createWindow(profile) {
+ var newWindow = browserWindowComponent.createObject(root)
+ newWindow.currentWebView.profile = profile
+ profile.downloadRequested.connect(newWindow.onDownloadRequested)
+ return newWindow
+ }
+ function createDialog(profile) {
+ var newDialog = browserDialogComponent.createObject(root)
+ newDialog.currentWebView.profile = profile
+ return newDialog
+ }
function load(url) {
- var browserWindow = createWindow()
+ var browserWindow = createWindow(testProfile)
browserWindow.currentWebView.url = url
}
}