aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/meshbay-hub/tests/harness/mse_harness.mjs7
-rw-r--r--packages/meshbay-hub/tests/harness/window_leak.mjs4
-rw-r--r--packages/meshbay-hub/tests/test_transport_contracts.py4
-rw-r--r--packages/meshbay-hub/tests/test_video_buffer_ceiling.py4
-rw-r--r--packages/meshbay-node/tests/test_task_lifetime.py2
5 files changed, 14 insertions, 7 deletions
diff --git a/packages/meshbay-hub/tests/harness/mse_harness.mjs b/packages/meshbay-hub/tests/harness/mse_harness.mjs
index 437a542..91018ef 100644
--- a/packages/meshbay-hub/tests/harness/mse_harness.mjs
+++ b/packages/meshbay-hub/tests/harness/mse_harness.mjs
@@ -117,6 +117,7 @@ const queueRef = { current: [] };
const appendingRef = { current: false }, endedRef = { current: false };
const outstandingRef = { current: 0 }, lastPokeRef = { current: 0 };
const quotaRef = { current: 0 }, stalledRef = { current: false };
+const awaitingInitRef = { current: false };
const transportRef = {
current: {
connected: true,
@@ -130,11 +131,13 @@ const transportRef = {
const fns = new Function(
'sbRef,videoRef,msRef,queueRef,appendingRef,endedRef,outstandingRef,' +
'lastPokeRef,transportRef,BUFFER_BEHIND_S,BUFFER_AHEAD_S,QUEUE_HIGH_WATER,' +
- 'CREDIT_KEEPALIVE_MS,STREAM_WINDOW,quotaRef,stalledRef,console,useCallback',
+ 'CREDIT_KEEPALIVE_MS,STREAM_WINDOW,quotaRef,stalledRef,awaitingInitRef,' +
+ 'console,useCallback',
src + '\n return {currentRange, bufferedAhead, evictBehind, flushQueue, pump};'
)(sbRef, videoRef, msRef, queueRef, appendingRef, endedRef, outstandingRef,
lastPokeRef, transportRef, BUFFER_BEHIND_S, BUFFER_AHEAD_S, QUEUE_HIGH_WATER,
- CREDIT_KEEPALIVE_MS, STREAM_WINDOW, quotaRef, stalledRef, console, useCallback);
+ CREDIT_KEEPALIVE_MS, STREAM_WINDOW, quotaRef, stalledRef, awaitingInitRef,
+ console, useCallback);
// The player's own `updateend` listener, transcribed — the one part of the
// component that is a listener rather than a callback, and the place the
diff --git a/packages/meshbay-hub/tests/harness/window_leak.mjs b/packages/meshbay-hub/tests/harness/window_leak.mjs
index ae6d46e..d5185de 100644
--- a/packages/meshbay-hub/tests/harness/window_leak.mjs
+++ b/packages/meshbay-hub/tests/harness/window_leak.mjs
@@ -43,6 +43,8 @@ const flushQueue = () => {};
const gekRef = { current: null };
const window_ = { MeshBayCrypto: { decryptChunkBin: async () => new Uint8Array(4) } };
+const silentConsole = { log() {}, warn() {}, error() {} };
+
const handler = new Function(
'msg', 'cancelled', 'awaitingInitRef', 'outstandingRef', 'queueRef',
'entry', 'gekRef', 'pump', 'flushQueue', 'console', 'window',
@@ -52,7 +54,7 @@ const deliver = (n) => Promise.all(
Array.from({ length: n }, (_, i) => handler(
{ file_id: entry.id, segment_index: i, nonce: 'n', ct: 'c' },
cancelled, awaitingInitRef, outstandingRef, queueRef, entry, gekRef,
- pump, flushQueue, console, window_)));
+ pump, flushQueue, silentConsole, window_)));
const run = async () => {
// The whole window arrives while reinitAt is still awaiting its updateends.
diff --git a/packages/meshbay-hub/tests/test_transport_contracts.py b/packages/meshbay-hub/tests/test_transport_contracts.py
index 5da8104..5dc3b7b 100644
--- a/packages/meshbay-hub/tests/test_transport_contracts.py
+++ b/packages/meshbay-hub/tests/test_transport_contracts.py
@@ -155,7 +155,7 @@ def test_the_form_asks_one_question_not_two(app):
So there is one selector. "Open" is what makes a group listed, and the
request derives the rest.
"""
- form = app[app.index("function CreateGroupPage"):]
+ form = app[app.index("function CreateGroupFormSimple"):]
form = form[:form.index("\n}\n")]
assert "setVisibility(" not in form, "the visibility selector is back"
@@ -185,7 +185,7 @@ def test_the_strings_the_visibility_box_used_are_gone(app):
def test_the_form_starts_on_a_combination_the_api_accepts(app):
- form = app[app.index("function CreateGroupPage"):]
+ form = app[app.index("function CreateGroupFormSimple"):]
assert "useState('invite')" in form[:form.index("return html")]
diff --git a/packages/meshbay-hub/tests/test_video_buffer_ceiling.py b/packages/meshbay-hub/tests/test_video_buffer_ceiling.py
index 9063c46..cf38117 100644
--- a/packages/meshbay-hub/tests/test_video_buffer_ceiling.py
+++ b/packages/meshbay-hub/tests/test_video_buffer_ceiling.py
@@ -201,7 +201,9 @@ def test_appending_does_not_earn_credit(app):
as they could be written, which is as fast as the network allows.
"""
player = _player(app)
- handler = player[player.index("sb.addEventListener('updateend'"):]
+ # The real handler, not the one-liner in settled()
+ marker = "sb.addEventListener('updateend', () =>"
+ handler = player[player.index(marker):]
handler = handler[:handler.index("\n });")]
assert "grantStreamCredit" not in handler, (
"credit is granted from updateend, which fires for remove() too")
diff --git a/packages/meshbay-node/tests/test_task_lifetime.py b/packages/meshbay-node/tests/test_task_lifetime.py
index e1ebfed..592579c 100644
--- a/packages/meshbay-node/tests/test_task_lifetime.py
+++ b/packages/meshbay-node/tests/test_task_lifetime.py
@@ -45,7 +45,7 @@ def test_the_session_keeps_a_reference_to_what_it_starts(session):
spawn = session[session.index("def _spawn("):]
spawn = spawn[:spawn.index("\n def ", 1)]
assert "self._tasks.add(task)" in spawn, "the reference is what keeps it alive"
- assert "add_done_callback(self._tasks.discard)" in spawn, (
+ assert "self._tasks.discard(" in spawn and "add_done_callback(" in spawn, (
"without this the set grows for the life of the session")