commit | 284e07133a18046751c1ac1b313e69456b4928db | [log] [tgz] |
---|---|---|
author | Joe Mason <joenotcharles@google.com> | Fri Jan 19 00:25:21 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jan 19 00:25:21 2024 |
tree | ca990dc3a47650e265962d97e61ed4ae6738e18f | |
parent | 0c0c78fc84213379656c4273d34342f38e8069d6 [diff] |
Add GetSequenceBoundCallback to TestFuture TestFuture's isn't usable in the common test idiom: TestFuture<Value> future; base::RunLoop run_loop; DoSomethingOnAnArbitrarySequence( future.GetCallback().Then(run_loop.QuitClosure())); run_loop.Run(); Value value = future.Take(); Since the future's callback has a SequenceChecker to make sure it runs on the same sequence as Take(). This adds GetSequenceBoundCallback and GetSequenceBoundRepeatingCallback methods that wrap the callback in BindPostTask to run it on the future's sequence. This isn't the default to avoid confusing behaviour in code under test that doesn't expect messages posted back to the future's sequence. Also converts a random browser test that can't currently use TestFuture to use the new callback as a proof of concept. Change-Id: Iaba5b2fa0e859eb5ce7882d2b6f122df60203b64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5207030 Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Joe Mason <joenotcharles@google.com> Auto-Submit: Joe Mason <joenotcharles@google.com> Cr-Commit-Position: refs/heads/main@{#1249159}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.