Warning, /libraries/kirigami-addons/autotests/tst_sounds.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Han Young <hanyoung@protonmail.com>
0003  * SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
0004  *
0005  * SPDX-License-Identifier: LGPL-2.0-or-later
0006  */
0007 
0008 import QtQuick
0009 import QtTest
0010 import org.kde.kirigamiaddons.sounds
0011 import QtMultimedia
0012 
0013 SoundsPicker {
0014     id: soundsPicker
0015     theme: 'freedesktop'
0016     width: 50
0017     height: 50
0018 
0019     TestCase {
0020         name: "SoundsTest"
0021         when: windowShown
0022 
0023         function test_hasSounds() {
0024             compare(soundsPicker.model.rowCount() > 0, true);
0025         }
0026 
0027         function test_click() {
0028             mouseClick(soundsPicker, 5, 5);
0029             compare(soundsPicker.audioPlayer.playbackState, MediaPlayer.PlayingState)
0030             mouseClick(soundsPicker, 5, 5);
0031             compare(soundsPicker.audioPlayer.playbackState, MediaPlayer.PausedState)
0032         }
0033     }
0034 }