This is a follow-up to the previous change adding `gnrt` reruns support,
as the previous change placed the gnrt rerun at the end of an
uninterrupted lift, rather than at the end of the whole lift, where it
makes no difference if this is a continuation lift run or not.
Resolves https://github.com/brave/brave-browser/issues/48140
This PR runs a mechanical change to do IWYU on all files using the new
abseil functions, while also removing the old header inclusions for
`base::StringPrintf`.
A presubmit `BanRule` is also being added for the `base::` functions.
Resolves https://github.com/brave/brave-browser/issues/48143
This PR is the run of `gn format` on all `gn` files. This is a
mechanical change done with:
```sh
git ls-files -- "*.gn" | xargs gn format
git ls-files -- "*.gni" | xargs gn format
```
This change has been motivated primarily by an improvement to the
formatters privided by `gn` correcting cases of redundant target naming,
i.e cases where `//foo:foo` is used, and should just be `//foo`.
For this particular `gn` change, see:
https://chromium.googlesource.com/chromium/src/+/c822490a82cdb6ad479159683a92858f7c6f0a58
Resolves https://github.com/brave/brave-browser/issues/48161
These UaFs were happening because the observer cannot outlive the
delegate while the observation is still set. This change corrects that
for the case where `OnDestroyed` is being tested.
Resolves https://github.com/brave/brave-browser/issues/48147
Adds:
--base [commitRef] flag to npm run test which allows to only build & run tests affected since [commitRef].
npm run list_affected_tests -- --base [commitRef] that prints a list of all tests that need to run
This PR adds a capability and won't have an impact until CI changes are made.
Implementation Overview
Skips tests using gn analyze which tracks not only source files but also specified test-data.
The implementation works as follows:
determine available test targets using gn ls <outDir> --type=executable --testonly=true
determine affected files using git --name-only <GIT_PREVIOUS_SUCCESSFUL_COMMIT>
determine test that need running: gn analyze <outdir> analyze.json
filter out testsuites that are not listed by gn analyze
unless a filter has been modified
CLI
You can run npm run list_affected_tests -- -C [build_dir] --since_commit [COMMIT_REF] --suite [testSuite] --filters [gnfilter...] --files [extraFiles]
prints out what tests should run since COMMIT_REF for a given [build_dir] and test_suite(alias).
npm run list_affected_tests -- --base HEAD~ will print all tests affected by the change since the previous commit considering all test targets available.
Output might be: brave_browser_tests brave_unit_tests
npm run list_affected_tests -- --suite chromium_unit_tests will print all tests affected by the change since HEAD~ or origin/master.
Output might be: base_unittests components_unittests content_unittests net_unittests unit_tests
Instead of providing a suite you can also provide a gnfilter eg.
npm run list_affected_tests -- --filters '//brave/*'
which will only show affected tests that are within //brave. You'll need the quotes to ensure your shell doesn't expand the *
If you havn't changed files you can run hypotheticals using --files eg.:
npm run list_affected_tests -- --filters '//brave/*' --files='package.json test/BUILD.gn'
You can build&run the affected subset of tests by running npm run test <test_suite> --base [commitRef]
If you don't specify a commitRef then a commit will be determined in this order:
origin/master if you are on a branch
HEAD~ (previous commit) otherwise
This PR adds support for `brockit lift` and `brockit regen` to support
`gnrt` reruns committing. With `lift`, a `gnrt` rerun occurs at the end
of the lift process, and if successful, all files changed under
`third_party/rust` are committed as rerun updates.
There are also changes to `regen` to support `gnrt` reruns, however a
new flag has been added to `regen`, namely, `--dry-run` to permit
running all regen operations without committing them. This is useful if
in the future we decide to hook up dry run checks for these process in
CI.
Resolves https://github.com/brave/brave-browser/issues/48140
This gn arg allows the control of how linking instances can happen
concurrently. This is necessary for the Windows PR build CI which is
running out of memory when linking targets.
Additionally, this change corrects the parsing of `.env` values to carry
over their type through, as `concurrent_links` is an integer. This has
affected a few other values that are set by CI as integers.
Resolves https://github.com/brave/brave-browser/issues/48090
Fix cookie sharing in split view context menu with proper SameSite handling
This commit addresses cookie sharing issues when opening links in split view
via context menu by implementing proper initiator handling to respect
SameSite cookie attributes.
Key changes:
Cookie Security Fix:
- Modified "Open link in split view" context menu to use OpenURLParams with
proper initiator context instead of simple GURL
- Ensures SameSite=Strict cookies are not shared across different origins
when opening links in split view from context menu with test coverage
Implementation Details:
- Extended OpenLinkInSplitView() function signature to accept full
OpenURLParams instead of just GURL
- Previously, we opened a empty tab and then navigation was performed.
This is suspected to be the cause of cookie sharing issues, as we don't
give any hint about initiator.
Resolves https://github.com/brave/brave-browser/issues/47642
This updates the main iOS unit tests target to use the required test dependencies so we can remove the `//brave/ios/app` dependency and also fixes a provider dependency that was in the wrong spot.
This PR has additional replacements for base::StringPrintf with the
underlying abseil implementation absl::StrFormat.
This is mostly a mechanical change.
Resolves https://github.com/brave/brave-browser/issues/48076