mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-10 07:44:25 +00:00
c66ae7b2e4
Launch an Xspice and run: echo -ne "\033]844;127.0.0.1;9876\007" This will launch a SPiCE client connecting to 127.0.0.1:9876. Still need to add all the security stuff and generally be more defensive in the implementation.
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
suite("BusProcess:", function() {
|
|
var sut;
|
|
var clientGui, busConnection;
|
|
|
|
setup(function () {
|
|
clientGui = {};
|
|
busConnection = {};
|
|
sut = new wdi.BusProcess({ clientGui: clientGui, busConnection: busConnection });
|
|
});
|
|
|
|
suite('#parseMessage', function () {
|
|
test('Should fire "wrongPathError" when the type is "launchApplication" and the event is "applicationLauncherWrongAppPathError"', sinon.test(function () {
|
|
var body = {
|
|
type: wdi.BUS_TYPES.launchApplication,
|
|
event: "applicationLauncherWrongAppPathError"
|
|
};
|
|
this.mock(sut)
|
|
.expects('fire')
|
|
.once()
|
|
.withExactArgs('wrongPathError', body);
|
|
sut.parseMessage(body);
|
|
}));
|
|
test('Should not fire "wrongPathError" when the type is "launchApplication" and the event is not "applicationLauncherWrongAppPathError"', sinon.test(function () {
|
|
var body = {
|
|
type: wdi.BUS_TYPES.launchApplication,
|
|
event: "fakeEvent"
|
|
};
|
|
this.mock(sut)
|
|
.expects('fire')
|
|
.never();
|
|
sut.parseMessage(body);
|
|
}));
|
|
|
|
test('Should fire "applicationLaunchedSuccessfully" when the type is "launchApplication" and the event is "applicationLaunchedSuccessfully"', sinon.test(function () {
|
|
var body = {
|
|
type: wdi.BUS_TYPES.launchApplication,
|
|
event: "applicationLaunchedSuccessfully"
|
|
};
|
|
this.mock(sut)
|
|
.expects('fire')
|
|
.once()
|
|
.withExactArgs('applicationLaunchedSuccessfully', body);
|
|
sut.parseMessage(body);
|
|
}));
|
|
});
|
|
});
|