summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data/tst_audioMuted.qml
blob: 85f813f0c28db666d2df86d5f52685035c039a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick
import QtTest
import QtWebEngine

TestWebEngineView {
    id: view
    width: 400
    height: 400

    SignalSpy {
        id: spy
        target: view
        signalName: "audioMutedChanged"
    }

    TestCase {
        id: testCase
        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);
        }
    }
}