diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/publicapi/tst_publicapi.cpp | 7 | ||||
-rw-r--r-- | tests/quicktestbrowser/BrowserWindow.qml | 33 |
2 files changed, 26 insertions, 14 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 98e52352f..a6d7321b0 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -73,6 +73,7 @@ static QList<const QMetaObject *> typesToCheck = QList<const QMetaObject *>() << &QQuickWebEngineNewViewRequest::staticMetaObject << &QQuickWebEngineProfile::staticMetaObject << &QQuickWebEngineScript::staticMetaObject + << &QQuickWebEngineFullScreenRequest::staticMetaObject ; static QList<const char *> knownEnumNames = QList<const char *>(); @@ -127,6 +128,7 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineView.icon --> QUrl" << "QQuickWebEngineView.canGoBack --> bool" << "QQuickWebEngineView.canGoForward --> bool" + << "QQuickWebEngineView.isFullScreen --> bool" << "QQuickWebEngineView.loading --> bool" << "QQuickWebEngineView.loadProgress --> int" << "QQuickWebEngineView.titleChanged() --> void" @@ -138,6 +140,9 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineView.iconChanged() --> void" << "QQuickWebEngineView.linkHovered(QUrl) --> void" << "QQuickWebEngineView.navigationRequested(QQuickWebEngineNavigationRequest*) --> void" + << "QQuickWebEngineView.fullScreenRequested(QQuickWebEngineFullScreenRequest) --> void" + << "QQuickWebEngineView.isFullScreenChanged() --> void" + << "QQuickWebEngineView.fullScreenCancelled() --> void" << "QQuickWebEngineView.runJavaScript(QString,QJSValue) --> void" << "QQuickWebEngineView.runJavaScript(QString) --> void" << "QQuickWebEngineView.loadHtml(QString,QUrl) --> void" @@ -233,6 +238,8 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineScript.setWorldId(ScriptWorldId) --> void" << "QQuickWebEngineScript.setRunOnSubframes(bool) --> void" << "QQuickWebEngineScript.toString() --> QString" + << "QQuickWebEngineFullScreenRequest.toggleOn --> bool" + << "QQuickWebEngineFullScreenRequest.accept() --> void" ; static bool isCheckedEnum(const QByteArray &typeName) diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml index cb7de84dc..9e9f73646 100644 --- a/tests/quicktestbrowser/BrowserWindow.qml +++ b/tests/quicktestbrowser/BrowserWindow.qml @@ -54,12 +54,16 @@ ApplicationWindow { id: browserWindow property QtObject applicationRoot property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item.webView : null + property int previousVisibility: Window.Windowed property bool isFullScreen: visibility == Window.FullScreen onIsFullScreenChanged: { // This is for the case where the system forces us to leave fullscreen. - if (currentWebView) - currentWebView.state = isFullScreen ? "FullScreen" : "" + if (currentWebView && !isFullScreen) { + currentWebView.state = "" + if (currentWebView.isFullScreen) + currentWebView.fullScreenCancelled() + } } height: 600 @@ -89,7 +93,7 @@ ApplicationWindow { offTheRecord: true } - // Make sure the Qt.WindowFullscreenButtonHint is set on Mac. + // Make sure the Qt.WindowFullscreenButtonHint is set on OS X. Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint // Create a styleItem to determine the platform. @@ -141,7 +145,7 @@ ApplicationWindow { shortcut: "Escape" onTriggered: { if (browserWindow.isFullScreen) - browserWindow.showNormal() + browserWindow.visibility = browserWindow.previousVisibility } } Action { @@ -380,18 +384,19 @@ ApplicationWindow { } } - experimental { - isFullScreen: webEngineView.state == "FullScreen" && browserWindow.isFullScreen - onFullScreenRequested: { - if (fullScreen) { - webEngineView.state = "FullScreen" - browserWindow.showFullScreen(); - } else { - webEngineView.state = "" - browserWindow.showNormal(); - } + onFullScreenRequested: { + if (request.toggleOn) { + webEngineView.state = "FullScreen" + browserWindow.previousVisibility = browserWindow.visibility + browserWindow.showFullScreen() + } else { + webEngineView.state = "" + browserWindow.visibility = browserWindow.previousVisibility } + request.accept() + } + experimental { onFeaturePermissionRequested: { permBar.securityOrigin = securityOrigin; permBar.requestedFeature = feature; |