summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/ApplicationRoot.qml
diff options
context:
space:
mode:
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
}
}