|
@@ -76,7 +76,7 @@ describe('E2EE Context', () => {
|
76
|
76
|
await receiver.setKey(key, 0);
|
77
|
77
|
});
|
78
|
78
|
|
79
|
|
- it('with an audio frame', async done => {
|
|
79
|
+ it('with an audio frame', done => {
|
80
|
80
|
sendController = {
|
81
|
81
|
enqueue: encodedFrame => {
|
82
|
82
|
const data = new Uint8Array(encodedFrame.data);
|
|
@@ -90,10 +90,10 @@ describe('E2EE Context', () => {
|
90
|
90
|
}
|
91
|
91
|
};
|
92
|
92
|
|
93
|
|
- await sender.encodeFunction(makeAudioFrame(), sendController);
|
|
93
|
+ sender.encodeFunction(makeAudioFrame(), sendController);
|
94
|
94
|
});
|
95
|
95
|
|
96
|
|
- it('with a video frame', async done => {
|
|
96
|
+ it('with a video frame', done => {
|
97
|
97
|
sendController = {
|
98
|
98
|
enqueue: encodedFrame => {
|
99
|
99
|
const data = new Uint8Array(encodedFrame.data);
|
|
@@ -107,7 +107,7 @@ describe('E2EE Context', () => {
|
107
|
107
|
}
|
108
|
108
|
};
|
109
|
109
|
|
110
|
|
- await sender.encodeFunction(makeVideoFrame(), sendController);
|
|
110
|
+ sender.encodeFunction(makeVideoFrame(), sendController);
|
111
|
111
|
});
|
112
|
112
|
});
|
113
|
113
|
|
|
@@ -122,7 +122,7 @@ describe('E2EE Context', () => {
|
122
|
122
|
};
|
123
|
123
|
});
|
124
|
124
|
|
125
|
|
- it('with an audio frame', async done => {
|
|
125
|
+ it('with an audio frame', done => {
|
126
|
126
|
receiveController = {
|
127
|
127
|
enqueue: encodedFrame => {
|
128
|
128
|
const data = new Uint8Array(encodedFrame.data);
|
|
@@ -133,10 +133,10 @@ describe('E2EE Context', () => {
|
133
|
133
|
}
|
134
|
134
|
};
|
135
|
135
|
|
136
|
|
- await sender.encodeFunction(makeAudioFrame(), sendController);
|
|
136
|
+ sender.encodeFunction(makeAudioFrame(), sendController);
|
137
|
137
|
});
|
138
|
138
|
|
139
|
|
- it('with a video frame', async done => {
|
|
139
|
+ it('with a video frame', done => {
|
140
|
140
|
receiveController = {
|
141
|
141
|
enqueue: encodedFrame => {
|
142
|
142
|
const data = new Uint8Array(encodedFrame.data);
|
|
@@ -147,15 +147,10 @@ describe('E2EE Context', () => {
|
147
|
147
|
}
|
148
|
148
|
};
|
149
|
149
|
|
150
|
|
- await sender.encodeFunction(makeVideoFrame(), sendController);
|
|
150
|
+ sender.encodeFunction(makeVideoFrame(), sendController);
|
151
|
151
|
});
|
152
|
152
|
|
153
|
|
- it('the receiver ratchets forward', async done => {
|
154
|
|
- // Ratchet the key. We reimport from the raw bytes.
|
155
|
|
- const material = await importKey(key);
|
156
|
|
-
|
157
|
|
- await sender.setKey(await ratchet(material), 0);
|
158
|
|
-
|
|
153
|
+ it('the receiver ratchets forward', done => {
|
159
|
154
|
receiveController = {
|
160
|
155
|
enqueue: encodedFrame => {
|
161
|
156
|
const data = new Uint8Array(encodedFrame.data);
|
|
@@ -166,7 +161,16 @@ describe('E2EE Context', () => {
|
166
|
161
|
}
|
167
|
162
|
};
|
168
|
163
|
|
169
|
|
- await sender.encodeFunction(makeAudioFrame(), sendController);
|
|
164
|
+ const encodeFunction = async () => {
|
|
165
|
+ // Ratchet the key. We reimport from the raw bytes.
|
|
166
|
+ const material = await importKey(key);
|
|
167
|
+
|
|
168
|
+ await sender.setKey(await ratchet(material), 0);
|
|
169
|
+
|
|
170
|
+ sender.encodeFunction(makeAudioFrame(), sendController);
|
|
171
|
+ };
|
|
172
|
+
|
|
173
|
+ encodeFunction();
|
170
|
174
|
});
|
171
|
175
|
});
|
172
|
176
|
});
|