Add virtual buffer to make the GTK tests work
This commit is contained in:
@@ -33,6 +33,9 @@ test:
|
|||||||
before_script:
|
before_script:
|
||||||
- ./cicd/install-project-deps.sh
|
- ./cicd/install-project-deps.sh
|
||||||
- ./cicd/start-dbus.sh
|
- ./cicd/start-dbus.sh
|
||||||
|
- apt install xvfb
|
||||||
|
- Xvfb :119 -screen 0 1024x768x16 &
|
||||||
|
- export DISPLAY=:119
|
||||||
script:
|
script:
|
||||||
- pipenv run ./cicd/pytest.sh
|
- pipenv run ./cicd/pytest.sh
|
||||||
artifacts:
|
artifacts:
|
||||||
|
@@ -33,6 +33,7 @@ RUN apt update && \
|
|||||||
python3-pip \
|
python3-pip \
|
||||||
tk-dev \
|
tk-dev \
|
||||||
wget \
|
wget \
|
||||||
|
xvfb \
|
||||||
xz-utils \
|
xz-utils \
|
||||||
zlib1g-dev
|
zlib1g-dev
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<metadata_license>FSFAP</metadata_license>
|
<metadata_license>FSFAP</metadata_license>
|
||||||
<project_license>GPL-3.0+</project_license>
|
<project_license>GPL-3.0+</project_license>
|
||||||
<name>Sublime Music</name>
|
<name>Sublime Music</name>
|
||||||
<summary>Native Subsonic client for Linux</summary>
|
<summary>A native GTK music player with *sonic support</summary>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
|
@@ -258,14 +258,14 @@ class SublimeMusicApp(Gtk.Application):
|
|||||||
inital_sync_result = AdapterManager.initial_sync()
|
inital_sync_result = AdapterManager.initial_sync()
|
||||||
inital_sync_result.add_done_callback(lambda _: self.update_window())
|
inital_sync_result.add_done_callback(lambda _: self.update_window())
|
||||||
|
|
||||||
# Start a loop for testing the ping.
|
# Start a loop for periodically updating the window every 10 seconds.
|
||||||
def ping_update():
|
def periodic_update():
|
||||||
if self.exiting:
|
if self.exiting:
|
||||||
return
|
return
|
||||||
self.update_window()
|
self.update_window()
|
||||||
GLib.timeout_add(10000, ping_update)
|
GLib.timeout_add(10000, periodic_update)
|
||||||
|
|
||||||
GLib.timeout_add(10000, ping_update)
|
GLib.timeout_add(10000, periodic_update)
|
||||||
|
|
||||||
# Prompt to load the play queue from the server.
|
# Prompt to load the play queue from the server.
|
||||||
if self.app_config.server.sync_enabled:
|
if self.app_config.server.sync_enabled:
|
||||||
@@ -536,6 +536,8 @@ class SublimeMusicApp(Gtk.Application):
|
|||||||
if self.app_config.state.current_song_index < 0:
|
if self.app_config.state.current_song_index < 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.app_config.state.playing = not self.app_config.state.playing
|
||||||
|
|
||||||
if self.player.song_loaded:
|
if self.player.song_loaded:
|
||||||
self.player.toggle_play()
|
self.player.toggle_play()
|
||||||
self.save_play_queue()
|
self.save_play_queue()
|
||||||
@@ -543,7 +545,6 @@ class SublimeMusicApp(Gtk.Application):
|
|||||||
# This is from a restart, start playing the file.
|
# This is from a restart, start playing the file.
|
||||||
self.play_song(self.app_config.state.current_song_index)
|
self.play_song(self.app_config.state.current_song_index)
|
||||||
|
|
||||||
self.app_config.state.playing = not self.app_config.state.playing
|
|
||||||
self.update_window()
|
self.update_window()
|
||||||
|
|
||||||
def on_next_track(self, *args):
|
def on_next_track(self, *args):
|
||||||
|
5
tests/common_ui_tests.py
Normal file → Executable file
5
tests/common_ui_tests.py
Normal file → Executable file
@@ -1,5 +1,10 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import gi
|
||||||
|
|
||||||
|
gi.require_version("Gtk", "3.0")
|
||||||
|
from gi.repository import Gtk # noqa: F401
|
||||||
|
|
||||||
from sublime.ui import common
|
from sublime.ui import common
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user