Skip to content

Commit

Permalink
Update to dbus-next 0.5.1
Browse files Browse the repository at this point in the history
The `connection` member of the bus has been made private. Errors are
forwarded to the bus itself. Use the new `disconnect()` method to
diconnect from the bus during testing.
  • Loading branch information
Tony Crisci authored and emersion committed Apr 4, 2019
1 parent 04087aa commit cdadcfe
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"homepage": "https://github.com/emersion/mpris-service",
"dependencies": {
"dbus-next": "^0.4.2",
"dbus-next": "^0.5.1",
"deep-equal": "^1.0.1",
"source-map-support": "^0.5.9"
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Player.prototype.init = function(opts) {

this._bus = dbus.sessionBus();

this._bus.connection.on('error', (err) => {
this._bus.on('error', (err) => {
this.emit('error', err);
});

Expand Down
6 changes: 3 additions & 3 deletions test/multiple-instances.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ player2.on('error', errorHandler);
let bus = dbus.sessionBus();

afterAll(() => {
player1._bus.connection.stream.end();
player2._bus.connection.stream.end();
bus.connection.stream.end();
player1._bus.disconnect();
player2._bus.disconnect();
bus.disconnect();
});

test('creating two players with the same name on the same bus should create the second one as an instance', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ player.on('error', (err) => {
let bus = dbus.sessionBus();

afterAll(() => {
player._bus.connection.stream.end();
bus.connection.stream.end();
player._bus.disconnect();
bus.disconnect();
});

test('creating a player exports the root and player interfaces on the bus', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/playlists.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ player.on('error', (err) => {
let bus = dbus.sessionBus();

afterAll(() => {
player._bus.connection.stream.end();
bus.connection.stream.end();
player._bus.disconnect();
bus.disconnect();
});

test('creating a player exports the playlists interfaces on the bus', async () => {
Expand Down
6 changes: 3 additions & 3 deletions test/root.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ player.on('error', (err) => {
let bus = dbus.sessionBus();

afterAll(() => {
player._bus.connection.stream.end();
bus.connection.stream.end();
player._bus.disconnect();
bus.disconnect();
});

test('calling methods should raise a signal on the player', async () => {
let obj = await bus.getProxyObject('org.mpris.MediaPlayer2.roottest', '/org/mpris/MediaPlayer2');
let root = obj.getInterface(ROOT_IFACE);
let root = obj.interfaces[ROOT_IFACE];

if (!root) {
// XXX need to wait a beat for the service to start up
Expand Down

0 comments on commit cdadcfe

Please sign in to comment.