Comments (11)
So a typical workflow is:
- A track is playing, a "Pause" button is shown
- The user clicks the "Pause" button
- The client calls the PlayPause dbus method
- The app accepts this request and pauses the current track
- The app updates the service state to notify that the current track is paused
- The client figures out that the current track is now paused
- The client changes the "Pause" button text to "Play"
That ensures that even if multiple clients are connected to the service, all actions are correctly synced across them.
from mpris-service.
We have an integration test suite now. Run with npm run test
.
from mpris-service.
It really depends on what module does and how can we make sure that it does what it should.
E.g. for databases that would be check that inserted rows are persisted and can be queried.
Sorry if this kind of obvious, maybe you can give some insight on how can we for example make sure that our service sets proper variables or keeps some state.
Another approach would be to just mock everything and test against pure mock, but this is kind of self-delusion.
from mpris-service.
This service just offers:
- Data about the current playback state
- Methods to change the playback state
So we would need a dbus client which checks that returned data is correct and that the right methods are called with the right arguments. We could do this with the dbus module directly.
Mocking everything seems not a very good approach.
from mpris-service.
mm, isn't calling
Methods to change the playback state
would change
Data about the current playback state
?
from mpris-service.
No, because calling methods are requests to change the playback state, and apps using the service must process those requests and explicitly update the playback state themselves. Apps can reject some requests (like clicking "Next" when there is no more tracks in the play queue).
from mpris-service.
Right, so we need to implement some kind of test client as you suggested, to listen to these events and which we can ask for current state.
from mpris-service.
I need this module as part of martpie/museeks#93, maybe you can join our gitter channel and we can talk?
from mpris-service.
The problem is: which library should we use to write the test client? If we want to switch to the native implementation, it would be unfortunate to use the dbus bindings for tests. Maybe first write tests with the native implementation, and then switch the whole library to native?
from mpris-service.
Maybe first write tests with the native implementation, and then switch the whole library to native?
+1 for that, we can also learn the library itself in the process
from mpris-service.
Okay, so I'll create a branch for that and give you push access to it, to be able to work collaboratively.
from mpris-service.
Related Issues (20)
- Error: The module was compiled against a different Node.js version using NODE_MODULE_VERSION 48. HOT 6
- Metadata don't work HOT 5
- CanGoPrevious & CanGoNext variable updating but mpris is not HOT 2
- Add CI HOT 5
- mpris-service 2.0 fails because of JSBI.BigInt with Webpack HOT 9
- Sending/Receiving negative numbers HOT 2
- Player implementation status
- Support multiple instances
- DBus connection error handling
- Documentation hosting HOT 1
- Move to dbusjs organization HOT 2
- TypeError: JSBI.BigInt is not a function HOT 6
- Media Keys stop working after closing window HOT 4
- Got error when detecting the player status using other scripts HOT 3
- TypeError: JSBI.BigInt is not a function HOT 4
- Changing property results in EPIPE errors HOT 3
- use latest dbus-next HOT 4
- Typo: `that` instead of `this` HOT 1
- Error while executing `GetAll` on `org.freedesktop.DBus.Properties`
- Can I use this to discover other players? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpris-service.