NetzenbotandClaude Opus 4.6 5d80fd8a18 Fix flaky BraveWalletSignMessageBrowserTest.SIWE test (#34285)
* Fix flaky BraveWalletSignMessageBrowserTest.SIWE test

The SIWE test sends two sign messages per iteration: one with matching
origin and one with a different origin ("www.a.com"). The second message
is rejected immediately by the provider, overwriting the global
signMessageResult variable with an error. After
NotifySignMessageRequestProcessed approves the first message, the test
immediately checked signMessageResult, but the mojo approval response
may not have been delivered to the renderer yet, so signMessageResult
still contained the rejection error.

Fix by replacing the immediate getSignMessageResult() check with a
Promise-based wait that polls until signMessageResult is a string
starting with "0x" (the signature). This is safe because both the
rejection and approval go through the same mojo interface, so the
rejection always arrives before the approval.

Resolves https://github.com/brave/brave-browser/issues/53167

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address review: fix same race condition in other sign message tests

Apply the same async polling pattern to UserApprovedRequest and
UserRejectedRequest tests, which had the same race condition of
calling getSignMessageResult() immediately after
NotifySignMessageRequestProcessed() without waiting for the mojo
response to arrive at the renderer.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 13:12:55 -05:00
2026-02-26 14:14:53 +00:00
2026-03-02 17:18:22 +00:00
2026-03-02 16:03:20 +00:00
2026-03-02 16:03:20 +00:00
2026-03-02 16:03:20 +00:00

Brave Core

Brave Core is a set of changes, APIs, and scripts used for customizing Chromium to make the Brave browser. Please also check https://github.com/brave/brave-browser

Follow @brave on Twitter for important announcements.

Resources

Community

You can ask questions and interact with the community in the following locations:

S
Description
No description provided
Readme MPL-2.0
3.8 GiB
Languages
C++ 36.9%
HTML 31.6%
Swift 9.4%
TypeScript 9%
Java 4.8%
Other 8.1%