diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-05-11 11:42:08 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-05-11 17:02:43 +0200 |
commit | a1b6a4c9edab853f06b870d9ef60a50b28ca36a6 (patch) | |
tree | abcdf44e8cb1bed6339de3fd4d28b86e0a7dba4d /tests/quicktestbrowser/ApplicationRoot.qml | |
parent | 18cc8aa2893e62f2b2679e67ed4747243e25da35 (diff) | |
parent | 76a990cfa3409214530e77d132cdefd9e96685f9 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I122ca8d3438333c6b41f751c47b1ce1f9a7066b9
Diffstat (limited to 'tests/quicktestbrowser/ApplicationRoot.qml')
-rw-r--r-- | tests/quicktestbrowser/ApplicationRoot.qml | 25 |
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 } } |