mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Lightly massage some of the generated JavaScript
This commit is contained in:
parent
31ad9566e6
commit
1867a3f121
19 changed files with 986 additions and 989 deletions
|
@ -1,8 +1,6 @@
|
|||
// Generated by CoffeeScript 2.4.1
|
||||
// Fake snowflake to interact with
|
||||
var snowflake;
|
||||
|
||||
snowflake = {
|
||||
var snowflake = {
|
||||
ui: new UI,
|
||||
broker: {
|
||||
sendAnswer: function() {}
|
||||
|
@ -11,24 +9,25 @@ snowflake = {
|
|||
};
|
||||
|
||||
describe('Init', function() {
|
||||
|
||||
it('gives a dialog when closing, only while active', function() {
|
||||
var msg, silenceNotifications;
|
||||
silenceNotifications = false;
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY;
|
||||
msg = window.onbeforeunload();
|
||||
var msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.WEBRTC_READY);
|
||||
expect(msg).toBe(Snowflake.MESSAGE.CONFIRMATION);
|
||||
snowflake.state = Snowflake.MODE.INIT;
|
||||
msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.INIT);
|
||||
return expect(msg).toBe(null);
|
||||
expect(msg).toBe(null);
|
||||
});
|
||||
return it('does not give a dialog when silent flag is on', function() {
|
||||
var msg, silenceNotifications;
|
||||
|
||||
it('does not give a dialog when silent flag is on', function() {
|
||||
silenceNotifications = true;
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY;
|
||||
msg = window.onbeforeunload();
|
||||
var msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.WEBRTC_READY);
|
||||
return expect(msg).toBe(null);
|
||||
expect(msg).toBe(null);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue