@editframe/elements 0.6.0-beta.16 → 0.6.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/lib/av/EncodedAsset.cjs +4 -1
  2. package/dist/lib/av/EncodedAsset.js +4 -1
  3. package/dist/packages/elements/src/EF_FRAMEGEN.d.ts +1 -1
  4. package/dist/packages/elements/src/elements/EFMedia.cjs +1 -1
  5. package/dist/packages/elements/src/elements/EFMedia.d.ts +1 -1
  6. package/dist/packages/elements/src/elements/EFMedia.js +1 -1
  7. package/dist/packages/elements/src/elements/EFTimegroup.cjs +38 -31
  8. package/dist/packages/elements/src/elements/EFTimegroup.d.ts +1 -1
  9. package/dist/packages/elements/src/elements/EFTimegroup.js +38 -31
  10. package/dist/packages/elements/src/gui/EFFilmstrip.cjs +128 -27
  11. package/dist/packages/elements/src/gui/EFFilmstrip.d.ts +7 -6
  12. package/dist/packages/elements/src/gui/EFFilmstrip.js +129 -28
  13. package/dist/packages/elements/src/gui/TWMixin.css.cjs +1 -1
  14. package/dist/packages/elements/src/gui/TWMixin.css.js +1 -1
  15. package/dist/packages/elements/src/index.cjs +6 -2
  16. package/dist/packages/elements/src/index.d.ts +2 -2
  17. package/dist/packages/elements/src/index.js +4 -3
  18. package/dist/style.css +21 -3
  19. package/package.json +2 -2
  20. package/src/elements/CrossUpdateController.ts +22 -0
  21. package/src/elements/EFAudio.ts +40 -0
  22. package/src/elements/EFCaptions.ts +188 -0
  23. package/src/elements/EFImage.ts +68 -0
  24. package/src/elements/EFMedia.ts +384 -0
  25. package/src/elements/EFSourceMixin.ts +57 -0
  26. package/src/elements/EFTemporal.ts +231 -0
  27. package/src/elements/EFTimegroup.browsertest.ts +333 -0
  28. package/src/elements/EFTimegroup.ts +389 -0
  29. package/src/elements/EFTimeline.ts +13 -0
  30. package/src/elements/EFVideo.ts +103 -0
  31. package/src/elements/EFWaveform.ts +409 -0
  32. package/src/elements/FetchMixin.ts +19 -0
  33. package/src/elements/TimegroupController.ts +25 -0
  34. package/src/elements/durationConverter.ts +6 -0
  35. package/src/elements/parseTimeToMs.ts +9 -0
  36. package/src/elements/util.ts +24 -0
  37. package/src/gui/EFFilmstrip.ts +878 -0
  38. package/src/gui/EFWorkbench.ts +231 -0
  39. package/src/gui/TWMixin.css +3 -0
  40. package/src/gui/TWMixin.ts +30 -0
@@ -0,0 +1,231 @@
1
+ import type { LitElement, ReactiveController } from "lit";
2
+ import { consume, createContext } from "@lit/context";
3
+ import { property, state } from "lit/decorators.js";
4
+ import type { EFTimegroup } from "./EFTimegroup";
5
+
6
+ import { durationConverter } from "./durationConverter";
7
+ import { Task } from "@lit/task";
8
+ import { EF_INTERACTIVE } from "../EF_INTERACTIVE";
9
+
10
+ export const timegroupContext = createContext<EFTimegroup>(
11
+ Symbol("timeGroupContext"),
12
+ );
13
+
14
+ export declare class TemporalMixinInterface {
15
+ get hasOwnDuration(): boolean;
16
+ get durationMs(): number;
17
+ get startTimeMs(): number;
18
+ get startTimeWithinParentMs(): number;
19
+ get endTimeMs(): number;
20
+ get ownCurrentTimeMs(): number;
21
+
22
+ parentTimegroup?: EFTimegroup;
23
+ rootTimegroup?: EFTimegroup;
24
+
25
+ frameTask: Task<readonly unknown[], unknown>;
26
+ }
27
+
28
+ export const isEFTemporal = (obj: any): obj is TemporalMixinInterface =>
29
+ obj[EF_TEMPORAL];
30
+
31
+ const EF_TEMPORAL = Symbol("EF_TEMPORAL");
32
+
33
+ export const deepGetTemporalElements = (
34
+ element: Element,
35
+ temporals: TemporalMixinInterface[] = [],
36
+ ) => {
37
+ for (const child of element.children) {
38
+ if (isEFTemporal(child)) {
39
+ temporals.push(child);
40
+ }
41
+ deepGetTemporalElements(child, temporals);
42
+ }
43
+ return temporals;
44
+ };
45
+
46
+ export const deepGetElementsWithFrameTasks = (
47
+ element: Element,
48
+ elements: Array<HTMLElement & { frameTask: Task }> = [],
49
+ ) => {
50
+ for (const child of element.children) {
51
+ if ("frameTask" in child && child.frameTask instanceof Task) {
52
+ elements.push(child as HTMLElement & { frameTask: Task });
53
+ }
54
+ deepGetElementsWithFrameTasks(child, elements);
55
+ }
56
+ return elements;
57
+ };
58
+
59
+ export const shallowGetTemporalElements = (
60
+ element: Element,
61
+ temporals: TemporalMixinInterface[] = [],
62
+ ) => {
63
+ for (const child of element.children) {
64
+ if (isEFTemporal(child)) {
65
+ temporals.push(child);
66
+ } else {
67
+ shallowGetTemporalElements(child, temporals);
68
+ }
69
+ }
70
+ return temporals;
71
+ };
72
+
73
+ export class OwnCurrentTimeController implements ReactiveController {
74
+ constructor(
75
+ private host: EFTimegroup,
76
+ private temporal: TemporalMixinInterface & LitElement,
77
+ ) {
78
+ host.addController(this);
79
+ }
80
+
81
+ hostUpdated() {
82
+ this.temporal.requestUpdate("ownCurrentTimeMs");
83
+ }
84
+
85
+ remove() {
86
+ this.host.removeController(this);
87
+ }
88
+ }
89
+
90
+ type Constructor<T = {}> = new (...args: any[]) => T;
91
+
92
+ export const EFTemporal = <T extends Constructor<LitElement>>(
93
+ superClass: T,
94
+ ) => {
95
+ class TemporalMixinClass extends superClass {
96
+ ownCurrentTimeController?: OwnCurrentTimeController;
97
+
98
+ #parentTimegroup?: EFTimegroup;
99
+ @consume({ context: timegroupContext, subscribe: true })
100
+ @property({ attribute: false })
101
+ set parentTimegroup(value: EFTimegroup | undefined) {
102
+ this.#parentTimegroup = value;
103
+ this.ownCurrentTimeController?.remove();
104
+ this.rootTimegroup = this.getRootTimegroup();
105
+ if (this.rootTimegroup) {
106
+ this.ownCurrentTimeController = new OwnCurrentTimeController(
107
+ this.rootTimegroup,
108
+ this,
109
+ );
110
+ }
111
+ }
112
+ get parentTimegroup() {
113
+ return this.#parentTimegroup;
114
+ }
115
+
116
+ @property({
117
+ type: String,
118
+ attribute: "offset",
119
+ converter: durationConverter,
120
+ })
121
+ private _offsetMs = 0;
122
+
123
+ @property({
124
+ type: Number,
125
+ attribute: "duration",
126
+ converter: durationConverter,
127
+ })
128
+ private _durationMs?: number;
129
+
130
+ @state()
131
+ rootTimegroup?: EFTimegroup = this.getRootTimegroup();
132
+
133
+ private getRootTimegroup(): EFTimegroup | undefined {
134
+ let parent =
135
+ this.tagName === "EF-TIMEGROUP" ? this : this.parentTimegroup;
136
+ while (parent?.parentTimegroup) {
137
+ parent = parent.parentTimegroup;
138
+ }
139
+ return parent as EFTimegroup | undefined;
140
+ }
141
+
142
+ get hasOwnDuration() {
143
+ return false;
144
+ }
145
+
146
+ // Defining this as a getter to a private property allows us to
147
+ // override it classes that include this mixin.
148
+ get durationMs() {
149
+ const durationMs =
150
+ this._durationMs || this.parentTimegroup?.durationMs || 0;
151
+ return durationMs || 0;
152
+ }
153
+
154
+ get offsetMs() {
155
+ return this._offsetMs || 0;
156
+ }
157
+
158
+ get parentTemporal() {
159
+ let parent = this.parentElement;
160
+ while (parent && !isEFTemporal(parent)) {
161
+ parent = parent.parentElement;
162
+ }
163
+ return parent;
164
+ }
165
+
166
+ get startTimeWithinParentMs() {
167
+ if (!this.parentTemporal) {
168
+ return 0;
169
+ }
170
+ return this.startTimeMs - this.parentTemporal.startTimeMs;
171
+ }
172
+
173
+ get startTimeMs(): number {
174
+ const parentTimegroup = this.parentTimegroup;
175
+ if (!parentTimegroup) {
176
+ return 0;
177
+ }
178
+ switch (parentTimegroup.mode) {
179
+ case "sequence": {
180
+ const siblingTemorals = shallowGetTemporalElements(parentTimegroup);
181
+ const ownIndex = siblingTemorals.indexOf(this);
182
+ if (ownIndex === 0) {
183
+ return parentTimegroup.startTimeMs;
184
+ }
185
+ const previous = siblingTemorals[ownIndex - 1];
186
+ if (!previous) {
187
+ throw new Error("Previous temporal element not found");
188
+ }
189
+ return previous.startTimeMs + previous.durationMs;
190
+ }
191
+ case "contain":
192
+ case "fixed":
193
+ return parentTimegroup.startTimeMs + this.offsetMs;
194
+ default:
195
+ throw new Error(`Invalid time mode: ${parentTimegroup.mode}`);
196
+ }
197
+ }
198
+
199
+ get endTimeMs(): number {
200
+ return this.startTimeMs + this.durationMs;
201
+ }
202
+
203
+ get ownCurrentTimeMs() {
204
+ if (this.rootTimegroup) {
205
+ return Math.min(
206
+ Math.max(0, this.rootTimegroup.currentTimeMs - this.startTimeMs),
207
+ this.durationMs,
208
+ );
209
+ }
210
+ return 0;
211
+ }
212
+
213
+ frameTask = new Task(this, {
214
+ autoRun: EF_INTERACTIVE,
215
+ args: () => [this.ownCurrentTimeMs] as const,
216
+ task: async ([], { signal: _signal }) => {
217
+ let fullyUpdated = await this.updateComplete;
218
+ while (!fullyUpdated) {
219
+ fullyUpdated = await this.updateComplete;
220
+ }
221
+ },
222
+ });
223
+ }
224
+
225
+ Object.defineProperty(TemporalMixinClass.prototype, EF_TEMPORAL, {
226
+ value: true,
227
+ });
228
+
229
+ return TemporalMixinClass as unknown as Constructor<TemporalMixinInterface> &
230
+ T;
231
+ };
@@ -0,0 +1,333 @@
1
+ import { describe, test, assert, beforeEach } from "vitest";
2
+ import {
3
+ LitElement,
4
+ type TemplateResult,
5
+ html,
6
+ render as litRender,
7
+ } from "lit";
8
+ import { EFTimegroup } from "./EFTimegroup";
9
+ import "./EFTimegroup";
10
+ import { customElement } from "lit/decorators/custom-element.js";
11
+ import { EFTemporal } from "./EFTemporal";
12
+
13
+ beforeEach(() => {
14
+ for (let i = 0; i < localStorage.length; i++) {
15
+ const key = localStorage.key(i);
16
+ if (typeof key !== "string") continue;
17
+ localStorage.removeItem(key);
18
+ }
19
+ while (document.body.children.length) {
20
+ document.body.children[0]?.remove();
21
+ }
22
+ });
23
+
24
+ @customElement("test-temporal")
25
+ class TestTemporal extends EFTemporal(LitElement) {
26
+ get hasOwnDuration(): boolean {
27
+ return true;
28
+ }
29
+ }
30
+
31
+ declare global {
32
+ interface HTMLElementTagNameMap {
33
+ "test-temporal": TestTemporal;
34
+ }
35
+ }
36
+
37
+ const renderTimegroup = (result: TemplateResult) => {
38
+ const container = document.createElement("div");
39
+ litRender(result, container);
40
+ const firstChild = container.firstElementChild;
41
+ if (!firstChild) {
42
+ throw new Error("No first child found");
43
+ }
44
+ if (!(firstChild instanceof EFTimegroup)) {
45
+ throw new Error("First child is not an EFTimegroup");
46
+ }
47
+ document.body.appendChild(firstChild);
48
+ return firstChild;
49
+ };
50
+
51
+ describe(`<ef-timegroup mode="fixed">`, () => {
52
+ test("can explicitly set a duration in seconds", async () => {
53
+ const timegroup = renderTimegroup(
54
+ html`<ef-timegroup mode="fixed" duration="10s"></ef-timegroup>`,
55
+ );
56
+ assert.equal(timegroup.durationMs, 10_000);
57
+ });
58
+
59
+ test("can explicitly set a duration in milliseconds", async () => {
60
+ const timegroup = renderTimegroup(
61
+ html`<ef-timegroup mode="fixed" duration="10ms"></ef-timegroup>`,
62
+ );
63
+ assert.equal(timegroup.durationMs, 10);
64
+ });
65
+ });
66
+
67
+ describe(`<ef-timegroup mode="sequence">`, () => {
68
+ test("fixed duration is ignored", () => {
69
+ const timegroup = renderTimegroup(
70
+ html`<ef-timegroup mode="sequence" duration="10s"></ef-timegroup>`,
71
+ );
72
+ assert.equal(timegroup.durationMs, 0);
73
+ });
74
+
75
+ test("duration is the sum of child time groups", async () => {
76
+ const timegroup = renderTimegroup(
77
+ html`
78
+ <ef-timegroup mode="sequence">
79
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
80
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
81
+ </ef-timegroup>
82
+ `,
83
+ );
84
+ assert.equal(timegroup.durationMs, 10_000);
85
+ });
86
+
87
+ test("duration can include any element with a durationMs value", async () => {
88
+ const timegroup = renderTimegroup(
89
+ html`
90
+ <ef-timegroup mode="sequence">
91
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
92
+ <test-temporal duration="5s"></test-temporal>
93
+ </ef-timegroup>
94
+ `,
95
+ );
96
+
97
+ assert.equal(timegroup.durationMs, 10_000);
98
+ });
99
+
100
+ test("arbitrary html does not factor into the calculation of a sequence duration", () => {
101
+ const timegroup = renderTimegroup(
102
+ html`
103
+ <ef-timegroup mode="sequence">
104
+ <div>
105
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
106
+ </div>
107
+ </ef-timegroup>
108
+ `,
109
+ );
110
+ assert.equal(timegroup.durationMs, 5_000);
111
+ });
112
+
113
+ test("nested time groups do not factor into the calculation of a sequence duration", async () => {
114
+ const timegroup = renderTimegroup(
115
+ html`
116
+ <ef-timegroup mode="sequence">
117
+ <ef-timegroup mode="fixed" duration="5s">
118
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
119
+ </ef-timegroup>
120
+ </ef-timegroup>
121
+ `,
122
+ );
123
+ assert.equal(timegroup.durationMs, 5_000);
124
+ });
125
+ });
126
+
127
+ describe(`<ef-timegroup mode="contain">`, () => {
128
+ test("fixed duration is ignored", () => {
129
+ const timegroup = renderTimegroup(
130
+ html`<ef-timegroup mode="contain" duration="10s"></ef-timegroup>`,
131
+ );
132
+ assert.equal(timegroup.durationMs, 0);
133
+ });
134
+
135
+ test("duration is the maximum of it's child time groups", async () => {
136
+ const timegroup = renderTimegroup(
137
+ html`
138
+ <ef-timegroup mode="contain">
139
+ <ef-timegroup mode="fixed" duration="5s"></ef-timegroup>
140
+ <ef-timegroup mode="fixed" duration="10s"></ef-timegroup>
141
+ </ef-timegroup>
142
+ `,
143
+ );
144
+ assert.equal(timegroup.durationMs, 10_000);
145
+ });
146
+ });
147
+
148
+ describe("startTimeMs", () => {
149
+ test("is computed relative to the root time group", async () => {
150
+ const timegroup = renderTimegroup(
151
+ html`<ef-timegroup id="root" mode="sequence">
152
+ <ef-timegroup id="a" mode="fixed" duration="5s"></ef-timegroup>
153
+ <ef-timegroup id="b" mode="sequence">
154
+ <ef-timegroup id="c" mode="fixed" duration="5s"></ef-timegroup>
155
+ <ef-timegroup id="d" mode="contain">
156
+ <ef-timegroup id="e" mode="fixed" duration="5s"></ef-timegroup>
157
+ <ef-timegroup id="f" mode="fixed" duration="5s"></ef-timegroup>
158
+ </ef-timegroup>
159
+ </ef-timegroup>
160
+ </ef-timegroup>`,
161
+ );
162
+
163
+ const a = timegroup.querySelector("#a") as EFTimegroup;
164
+ const b = timegroup.querySelector("#b") as EFTimegroup;
165
+ const c = timegroup.querySelector("#c") as EFTimegroup;
166
+ const d = timegroup.querySelector("#d") as EFTimegroup;
167
+ const e = timegroup.querySelector("#e") as EFTimegroup;
168
+ const f = timegroup.querySelector("#f") as EFTimegroup;
169
+
170
+ assert.equal(a.startTimeMs, 0);
171
+ assert.equal(b.startTimeMs, 5_000);
172
+ assert.equal(c.startTimeMs, 5_000);
173
+ assert.equal(d.startTimeMs, 10_000);
174
+ assert.equal(e.startTimeMs, 10_000);
175
+ assert.equal(f.startTimeMs, 10_000);
176
+ });
177
+
178
+ // // TODO: Rethink offset math, it shouldn't effect the duration of a temporal item
179
+ // // but actually change the start and end time.
180
+ // litTest.skip("can be offset with offset attribute", async ({ container }) => {
181
+ // render(
182
+ // html`<ef-timegroup id="root" mode="contain">
183
+ // <test-temporal id="a" duration="5s" offset="5s"></test-temporal>
184
+ // </ef-timegroup> `,
185
+ // container,
186
+ // );
187
+
188
+ // const root = container.querySelector("#root") as EFTimegroup;
189
+ // const a = container.querySelector("#a") as TestTemporal;
190
+
191
+ // assert.equal(a.durationMs, 5_000);
192
+ // assert.equal(root.durationMs, 10_000);
193
+ // assert.equal(a.startTimeMs, 5_000);
194
+ // });
195
+
196
+ // litTest.skip(
197
+ // "offsets do not affect start time when in a sequence group",
198
+ // async ({ container }) => {
199
+ // render(
200
+ // html`<ef-timegroup id="root" mode="sequence">
201
+ // <test-temporal id="a" duration="5s"></test-temporal>
202
+ // <test-temporal id="b" duration="5s" offset="5s"></test-temporal>
203
+ // </ef-timegroup> `,
204
+ // container,
205
+ // );
206
+
207
+ // const root = container.querySelector("#root") as EFTimegroup;
208
+ // const a = container.querySelector("#a") as TestTemporal;
209
+ // const b = container.querySelector("#b") as TestTemporal;
210
+
211
+ // assert.equal(root.durationMs, 10_000);
212
+ // assert.equal(a.startTimeMs, 0);
213
+ // assert.equal(b.startTimeMs, 5_000);
214
+ // },
215
+ // );
216
+
217
+ test("temporal elements default to expand to fill a timegroup", async () => {
218
+ const timegroup = renderTimegroup(
219
+ html`<ef-timegroup id="root" mode="fixed" duration="10s">
220
+ <test-temporal id="a"></test-temporal>
221
+ </ef-timegroup> `,
222
+ );
223
+
224
+ const a = timegroup.querySelector("#a") as TestTemporal;
225
+
226
+ assert.equal(timegroup.durationMs, 10_000);
227
+ assert.equal(a.durationMs, 10_000);
228
+ });
229
+
230
+ test("element's parentTimegroup updates as they move", async () => {
231
+ const container = document.createElement("div");
232
+ document.body.appendChild(container);
233
+ const timegroup1 = document.createElement("ef-timegroup");
234
+ timegroup1.setAttribute("mode", "fixed");
235
+ timegroup1.setAttribute("duration", "5s");
236
+
237
+ const timegroup2 = document.createElement("ef-timegroup");
238
+ timegroup2.setAttribute("mode", "fixed");
239
+ timegroup2.setAttribute("duration", "5s");
240
+
241
+ container.appendChild(timegroup1);
242
+ container.appendChild(timegroup2);
243
+
244
+ const temporal = document.createElement("test-temporal");
245
+
246
+ timegroup1.appendChild(temporal);
247
+
248
+ assert.equal(temporal.parentTimegroup, timegroup1);
249
+
250
+ timegroup2.appendChild(temporal);
251
+ assert.equal(temporal.parentTimegroup, timegroup2);
252
+ });
253
+
254
+ test("elements can access their root temporal element", async () => {
255
+ const root = renderTimegroup(
256
+ html`<ef-timegroup id="root" mode="contain" duration="10s">
257
+ <ef-timegroup id="a" mode="contain">
258
+ <div>
259
+ <ef-timegroup id="b" mode="contain">
260
+ <div>
261
+ <test-temporal id="c" duration="5s"></test-temporal>
262
+ </div>
263
+ </ef-timegroup>
264
+ </div>
265
+ </ef-timegroup>
266
+ </ef-timegroup> `,
267
+ );
268
+
269
+ const a = root.querySelector("#a") as EFTimegroup;
270
+ const b = root.querySelector("#b") as EFTimegroup;
271
+ const c = root.querySelector("#c") as TestTemporal;
272
+
273
+ assert.equal(root.rootTimegroup, root);
274
+
275
+ assert.equal(a.rootTimegroup, root);
276
+ assert.equal(b.rootTimegroup, root);
277
+ assert.equal(c.rootTimegroup, root);
278
+ });
279
+ });
280
+
281
+ describe("setting currentTime", () => {
282
+ test("persists in localStorage if the timegroup has an id and is in the dom", async () => {
283
+ const timegroup = renderTimegroup(
284
+ html`<ef-timegroup id="root" mode="fixed" duration="10s"></ef-timegroup>`,
285
+ );
286
+ document.body.appendChild(timegroup);
287
+ assert.isNull(localStorage.getItem(timegroup.storageKey));
288
+ timegroup.currentTime = 5_000;
289
+ assert.equal(localStorage.getItem(timegroup.storageKey), "5000");
290
+ timegroup.remove();
291
+ });
292
+
293
+ test("does not persist in localStorage if the timegroup has no id", async () => {
294
+ const timegroup = renderTimegroup(
295
+ html`<ef-timegroup mode="fixed" duration="10s"></ef-timegroup>`,
296
+ );
297
+ document.body.appendChild(timegroup);
298
+ timegroup.currentTime = 5_000;
299
+ timegroup.removeAttribute("id");
300
+ assert.throws(() => {
301
+ assert.isNull(localStorage.getItem(timegroup.storageKey));
302
+ }, "Timegroup must have an id to use localStorage");
303
+ timegroup.remove();
304
+ });
305
+
306
+ test("nested items derive their ownCurrentTimeMs", async () => {
307
+ const timegroup = renderTimegroup(
308
+ html`
309
+ <ef-timegroup id="root" mode="sequence">
310
+ <ef-timegroup id="a" mode="fixed" duration="5s"> </ef-timegroup>
311
+ <ef-timegroup id="b" mode="fixed" duration="5s"> </ef-timegroup>
312
+ </ef-timegroup>
313
+ `,
314
+ );
315
+
316
+ const root = timegroup;
317
+ const a = timegroup.querySelector("#a") as EFTimegroup;
318
+ const b = timegroup.querySelector("#b") as EFTimegroup;
319
+
320
+ assert.equal(a.ownCurrentTimeMs, 0);
321
+ assert.equal(b.ownCurrentTimeMs, 0);
322
+
323
+ root.currentTimeMs = 2_500;
324
+
325
+ assert.equal(a.ownCurrentTimeMs, 2_500);
326
+ assert.equal(b.ownCurrentTimeMs, 0);
327
+
328
+ root.currentTimeMs = 7_500;
329
+
330
+ assert.equal(a.ownCurrentTimeMs, 5_000);
331
+ assert.equal(b.ownCurrentTimeMs, 2_500);
332
+ });
333
+ });