()
| 373 | return !!sample?.renderingOpportunity; |
| 374 | }, |
| 375 | read(): Sample { |
| 376 | if (!sample?.renderingOpportunity) { |
| 377 | throw new Error('Measurement did not complete'); |
| 378 | } |
| 379 | if (!armed || !matches(armed.conditions)) { |
| 380 | throw new Error('The expected result did not remain correct after completion'); |
| 381 | } |
| 382 | if (armed.layout) { |
| 383 | let layout = readLayout(armed.layout); |
| 384 | if (!layout || layoutSignature(layout) !== layoutSignature(sample.layout)) { |
| 385 | throw new Error('The variable-height layout changed after completion.'); |
| 386 | } |
| 387 | } |
| 388 | collect((observer?.takeRecords() ?? []) as EventEntry[]); |
| 389 | collectFrames((frameObserver?.takeRecords() ?? []) as LongFrameEntry[]); |
| 390 | return { |
| 391 | ...sample, |
| 392 | events: events.filter( |
| 393 | event => event.startTime >= sample!.start && event.startTime <= sample!.renderingOpportunity |
| 394 | ), |
| 395 | // A frame that began before the input event can still contain its handling. |
| 396 | longFrames: longFrames.filter( |
| 397 | frame => |
| 398 | frame.startTime + frame.duration >= sample!.start && |
| 399 | frame.startTime <= sample!.renderingOpportunity |
| 400 | ) |
| 401 | }; |
| 402 | } |
| 403 | }; |
nothing calls this directly
no test coverage detected