Skip to content

[browser] test that Task.Yield yields to browser event loop #113531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2025

Conversation

pavelsavara
Copy link
Member

just sanity tests :)

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Mar 14, 2025
@pavelsavara pavelsavara added this to the 10.0.0 milestone Mar 14, 2025
@pavelsavara pavelsavara self-assigned this Mar 14, 2025
@Copilot Copilot AI review requested due to automatic review settings March 14, 2025 13:38
@pavelsavara pavelsavara requested a review from lewing as a code owner March 14, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds sanity tests to verify that Task.Yield yields control to the browser event loop. Key changes include the introduction of three new tests in YieldAwaitableTests.cs, the implementation of beforeYield, isSetTimeoutHit, and isPromiseThenHit in JavaScriptTestHelper.mjs, and the corresponding JsImport declarations added to JavaScriptTestHelper.cs.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
System/Runtime/InteropServices/JavaScript/YieldAwaitableTests.cs Adds tests to assert Task.Yield and Task.Delay behavior in the browser event loop
System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.mjs Implements helper functions to track event loop yielding
System/Runtime/InteropServices/JavaScript/JavaScriptTestHelper.cs Adds JsImport declarations for the new helper functions

@pavelsavara pavelsavara merged commit 36ca267 into dotnet:main Mar 15, 2025
93 of 95 checks passed
@pavelsavara pavelsavara deleted the browser_test_yield branch March 15, 2025 10:06
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants