diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-04-24 12:42:25 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-05-05 14:20:20 +0200 |
commit | 58cd21c0aa7a9dc5a18ea411dcf462a2ee8193f6 (patch) | |
tree | a778f350c4257eb888f87d7fee0091daa8042b9a /tests | |
parent | 9b21cff6f46d8e98b85996111bd8187ef2e45577 (diff) |
Fix setting WebEngineView.audioMuted before initialization
Fixes: QTBUG-83732
Change-Id: Ie07a1ecf87b214436ab7cea07003ddd5aeaedda3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_audioMuted.qml | 63 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/qmltests.pro | 1 |
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_audioMuted.qml b/tests/auto/quick/qmltests/data/tst_audioMuted.qml new file mode 100644 index 000000000..c626d07a0 --- /dev/null +++ b/tests/auto/quick/qmltests/data/tst_audioMuted.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtTest 1.0 +import QtWebEngine 1.4 + +TestWebEngineView { + id: view + width: 400 + height: 400 + + SignalSpy { + id: spy + target: view + signalName: "audioMutedChanged" + } + + TestCase { + id: test + name: "WebEngineViewAudioMuted" + + function test_audioMuted() { + compare(view.audioMuted, false); + view.audioMuted = true; + view.url = "about:blank"; + verify(view.waitForLoadSucceeded()); + compare(view.audioMuted, true); + compare(spy.count, 1); + compare(spy.signalArguments[0][0], true); + view.audioMuted = false; + compare(view.audioMuted, false); + compare(spy.count, 2); + compare(spy.signalArguments[1][0], false); + } + } +} + diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro index 0b3ff7c7e..5c57f7ad9 100644 --- a/tests/auto/quick/qmltests/qmltests.pro +++ b/tests/auto/quick/qmltests/qmltests.pro @@ -31,6 +31,7 @@ OTHER_FILES += \ $$PWD/data/titleupdate.js \ $$PWD/data/tst_action.qml \ $$PWD/data/tst_activeFocusOnPress.qml \ + $$PWD/data/tst_audioMuted.qml \ $$PWD/data/tst_contextMenu.qml \ $$PWD/data/tst_desktopBehaviorLoadHtml.qml \ $$PWD/data/tst_download.qml \ |