Skip to content

New Feature: Add ResourceTiming, Request.Initiator stack traces, and network tests (#2151)#3245

Merged
kblok merged 4 commits intomasterfrom
import-tests-2151
Feb 27, 2026
Merged

New Feature: Add ResourceTiming, Request.Initiator stack traces, and network tests (#2151)#3245
kblok merged 4 commits intomasterfrom
import-tests-2151

Conversation

@kblok
Copy link
Member

@kblok kblok commented Feb 26, 2026

Summary

  • New Feature: IResponse.Timing property — Adds ResourceTiming class with timing information (e.g., ReceiveHeadersEnd) for network responses, with support for both CDP and BiDi protocols
  • New Feature: Initiator.Stack property — Adds InitiatorStackTrace and CallFrame classes to expose the full initiator call stack on requests, enabling tracing of script-initiated network requests back to their source
  • Ports 9 missing upstream tests from network.spec.ts: request headers, request initiator, response buffer/status/timing, and raw network headers (set-cookie) tests
  • Adds test fixtures initiator.html and initiator.js

Closes #2151

Test plan

  • All new tests pass with Chrome/CDP
  • All new tests pass with Firefox/BiDi
  • Full NetworkTests suite passes
  • HandlesMissingStatusText added to local expectations (ASP.NET Core Kestrel defaults empty ReasonPhrase to "OK")

🤖 Generated with Claude Code

kblok and others added 4 commits February 26, 2026 11:34
Port missing upstream tests for network.spec.ts:
- Request.headers: should define Browser in user agent header
- Request.initiator: should return the initiator
- Response.buffer: should throw if the response does not have a body
- Response.statusText: handles missing status text
- Response.timing: returns timing information
- raw network headers: Same-origin set-cookie navigation
- raw network headers: Same-origin set-cookie subresource
- raw network headers: Cross-origin set-cookie

Also adds supporting library changes:
- ResourceTiming class and Timing property on IResponse/Response
- CallFrame and InitiatorStackTrace classes
- Stack property on Initiator
- Test fixtures: initiator.html and initiator.js

Co-Authored-By: Claude Opus 4.6 <[email protected]>
BidiHttpResponse was not setting the Timing property, causing
NullReferenceException in ReturnsTimingInformation test on Firefox.
Maps FetchTimingInfo fields to ResourceTiming matching upstream behavior.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Local ignores should never be added for upstream test failures.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
ASP.NET Core Kestrel does not support sending empty HTTP reason phrases -
it defaults to 'OK' for status 200 regardless of ReasonPhrase setting.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kblok kblok changed the title Add missing tests: network.spec.ts (#2151) New Feature: Add ResourceTiming, Request.Initiator stack traces, and network tests (#2151) Feb 27, 2026
@kblok kblok merged commit c0ba4c5 into master Feb 27, 2026
14 checks passed
@kblok kblok deleted the import-tests-2151 branch February 27, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing tests network.spec.ts

1 participant