Files
sousa-gecko/testing/web-platform/tests/infrastructure/test262/timeout.js
T
James C Scott III 438b64ffa8 Bug 2006815 [wpt PR 56842] - feat(runner): Integrate Test262 execution with wptrunner and add smoke tests [pt 3/5], a=testonly
Automatic update from web-platform-tests
feat(runner): Integrate Test262 execution with wptrunner and add smoke tests [pt 3/5] (#56842)

* feat(runner): Integrate Test262 execution with wptrunner and add smoke tests

This commit completes the core integration of Test262 into the WPT
runner (`wptrunner`), enabling the execution of Test262 JavaScript
conformance tests within the browser environment. This work builds upon
the manifest tooling (PR 1 #56840) and server-side handling (PR 2 #56841) to provide
a full end-to-end testing solution for Test262.

Key components introduced and integrated:
- **Client-Side Harness:** New JavaScript files (`harness-adapter.js`,
  `testharness-client.js`, `testharness.js`) under `resources/test262/`
  provide the necessary environment for Test262 tests to execute in an
  `iframe` and report results back to the main WPT testharness.
- **Test262 Assertion Libraries (Vendored):** For the purpose of enabling these
  initial smoke tests, the standard Test262 assertion libraries (`assert.js`
  and `sta.js`) are directly placed into `third_party/test262/harness/`.
  This provides the immediate dependencies required by the smoke tests.
  An autoamted vendoring solution, including version tracking via
  `vendored.toml`, will be implemented in a subsequent PR focused on
  automated updates, as described in the RFC.
- **Wptrunner Integration:** Modifications to `tools/wptrunner/wpttest.py`
  and `tools/wptrunner/browsers/*.py` enable `wptrunner` to recognize the
  `test262` test type and execute it using existing testharness executors.
- **Smoke Tests and Metadata:** A suite of basic Test262 smoke tests
  (`infrastructure/test262/`) and their corresponding expected results
  (`infrastructure/metadata/infrastructure/test262/`) are added to verify
  the correct functioning of the entire integration.
- **Linting Exemption:** `lint.ignore` is updated to exclude the vendored
  Test262 harness files from linting, respecting their upstream style.

This integration allows browser vendors to run Test262 directly with `wptrunner`,
streamlining conformance testing efforts as specified in the RFC:
https://github.com/web-platform-tests/rfcs/pull/229

This commit is the third in a series of smaller PRs split from the larger,
original implementation in https://github.com/web-platform-tests/wpt/pull/55997.

* address feedback

* address more feedback

* address feedback

* address feedback

* Apply suggestion from @jcscottiii

* fix lint

* move need third_party lint because other doesn't work

* fix lint

* Refactor Test262 integration to remove custom custom harness bridge
This commit addresses reviewer feedback (jgraham) regarding the Test262
integration "reimplementing a subset of testharness.js". The architecture
has been drastically simplified by eliminating the custom `postMessage`
protocol between the Test262 iframe and the parent WPT test wrapper.
Changes include:
- Deleted `test262-harness-bridge.js` completely.
- Updated the wrapper `<script>` generated by `tools/serve/serve.py` to
  expose a native `window.test262HarnessDone(status, error)` hook directly
  in the parent's `testharness.js` execution environment.
- Refactored `test262-reporter.js` to natively dispatch test completions
  and harness errors to this synchronous hook instead of manually wrapping
  results in `{type: "complete"}` message payloads.
- Ensured strict "Realm Isolation" is maintained for the `test262` tests,
  as required by `INTERPRETING.md`, by keeping all WPT globals cleanly
  isolated in the parent window.
- Updated `tools/serve/test_serve.py` assertions to reflect the removed
  bridge dependency.
- Leveraged `setTimeout` to safely elevate test harness crashes into the
  parent's macro-task queue, ensuring infrastructure `.ini` expectations
  (like timeouts and parsing ERRORs) correctly fail the WPT harness.

* Update tools/serve/serve.py

* update to docs from last commits

* touch ups

* nit

* start to address feedback

* finish feedback

* tidy up

* doc touchups

* add missing support for phases

* final touchups
--

wpt-commits: 0a0fd8c16c2a51e2c9b915780962500cd641eda7
wpt-pr: 56842
2026-04-23 10:14:03 +00:00

7 lines
129 B
JavaScript

/*---
description: An async Test262 test that times out
flags: [async]
---*/
// Never calls print('Test262:AsyncTestComplete');