Commit Graph
79 Commits
Author SHA1 Message Date
Aleksei Seren 0054da9a35 [ads] Brave Ads buildflag for /browser & /chromium_src (#33212)
* [ads] Brave Ads buildflag for `/browser` & `/chromium_src`

The PR adds Brave Ads buildflag checks to
`/browser` and `/chromium_src` directories code
which depends on Brave Ads. This is a pre-requisite
 for moving Brave Ads code under a build flag.

* Handle remaining brave_ads deps and includes

* Fix deps for `chrome/browser/prefs:impl`
2026-01-16 12:02:01 -05:00
Aleksei Khoroshilov e96780db83 Shutdown leaking BraveOriginPolicyManager instance correctly in tests (#31938)
* Shutdown leaking BraveOriginPolicyManager instance correctly in tests

* Fix CosmeticFiltersResources dangling.
2025-10-23 00:44:47 +07:00
Pavel Beloborodov a726ff3913 Allow any page to ask for localhost permission (#30840)
LocalhostPermissionComponent has been removed.
2025-10-03 17:36:08 +07:00
vadims c1933020e0 Refactoring of the PSST feature
It is first stage of the PSST feature implementation. The main goal
was to make the existing code ready to the next implementation
steps and be consistent with feature requirements.

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

---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
2025-07-23 21:45:51 +02:00
cdesouza-chromium 821274796b [IWYU] Fixing logging inclusions pt.11 (#29531)
This change is one of many fixing inclusion for the following files:

    - `base/notimplemented.h`
    - `base/notreached.h`
    - `base/check.h`
    - `base/dcheck_is_on.h`
    - `base/check_deref.h`
    - `base/check_op.h`
    - `base/logging/log_severity.h`
    - `base/logging.h`

This change is a mechanical change done with the following script:
https://github.com/brave/brave-browser/issues/46707#issuecomment-2960116515

Resolves https://github.com/brave/brave-browser/issues/46707
2025-06-12 13:48:07 +01:00
Brian Johnson afd4e0239d fix overly permissive DEPS (#27193)
Fix overly permissive deps
2025-01-12 21:43:04 -07:00
Mikhail b8a60ee66f Remove Greaselion (#26283)
* remove greaselion files
* cleanup *.h files
* cleanup *.cc files
* cleanup GN
* cleanup other files
* Fix presubmit
* Remove extension* from {push/pull}_l10n
2024-11-04 21:10:33 +01:00
Brian Johnson 3313ad628b remove include rules that no longer apply (#25911)
remove include rules that no longer apply and fix existing include rules
2024-10-10 16:19:48 -07:00
Claudio DeSouza ca0566ba67 TestingProfile override to add cration_time arg
`BraveTestingProfile` is used as a substitution, and it therefore it
must match the parent class constructor change.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/bb1ae862cc7112b9615fc08ca43a885aecef00e7

commit bb1ae862cc7112b9615fc08ca43a885aecef00e7
Author: Hidehiko Abe <hidehiko@chromium.org>
Date:   Tue Aug 27 05:08:43 2024 +0000

    Add CreateMode parameter to TestingProfile's ctor

    Also TestingProfile::Builder starts to support CreateMode.

    Bug: 341267441
    Test: Tryjob
2024-10-03 17:06:18 +01:00
mkarolin 6b6864a146 Hook up Brave resource bundle to Chromium unit tests suite. 2024-07-31 09:43:33 -04:00
mkarolin 41b080db96 Move Brave keyed services factories initialization to a common place.
This would also initialize Brave keyed services factories in upstream unit tests.
This is a solution proposed by bridiver.

Addresses various issues that this change introduced.
2024-07-31 09:43:32 -04:00
Jagadesh P 9ba12e98b7 [Farbling] Migrate |BraveFarblingService| as a keyed service dependent on the profile.
Behavioral Change: Now, the farbling's session token is isolated to each profile, and
also an incognito session originating from a different profile has a unique session token.
2024-07-23 13:32:23 +05:30
Jagadesh P a32a81e0e0 [Farbling] Migrate |BraveFarblingService| as a |KeyedService|. 2024-07-23 13:32:23 +05:30
vadimsandNuo Xu 43735ef5b2 Deprecate local node support and ipfs scheme (#23808)
deprecated IPFS local node support and IPFS scheme
https://github.com/brave/brave-browser/issues/37735
---------

Signed-off-by: Vadym Struts <vstruts@brave.com>
Co-authored-by: Nuo Xu <nuoxu.nx@gmail.com>
2024-07-09 12:34:31 +02:00
Brian Johnson 4bb42e9213 initial filter for macos upstream unit tests (#24052)
add filter for macos upstream unit tests
2024-06-07 10:48:14 -07:00
Brian Johnson 5b9f860a1f Browser test fixes (#23657)
Fixes various setup issues in browser tests that were causing tests to crash in debug mode where `!NDEBUG` checks are enabled
2024-06-03 16:23:44 -07:00
Simon Hong 68eb252e70 Renamed some vpn classes
* BraveVPNOSConnectionAPI -> BraveVPNConnectionManager
* RasConnectionAPIImplBase -> SystemVPNConnectionAPIImplBase
2024-02-15 12:04:09 +09:00
Jacob Sikorski ab332ff65c Cleanup brave_shields component 2024-02-12 15:47:01 -07:00
bridiver 3bd303c40b Fix browser test overrides 2023-11-09 13:00:14 -07:00
Arthur Edelstein bccdc83254 Remove HTTPS Everywhere (#19779) 2023-10-28 01:29:39 -04:00
sergei 82a623cc98 Skip attempts to set connection state until valid states 2023-10-05 15:17:58 +03:00
Darnell Andries b8b099bbd9 Move misc_metrics::MenuMetrics to ProcessMiscMetrics, a new class to encapsulate all misc_metrics classes that the browser process owns 2023-06-20 16:05:37 -07:00
Darnell Andries e1427279b3 Add P3A metrics for Android Privacy Hub report 2023-06-16 11:48:11 -07:00
Shivan Kaul Sahib 5b4dfafccc Use component update list for localhost permission prompting (#18354)
If permission not already given, only prompt if requesting URL is on allowlist
2023-05-18 19:46:34 -07:00
Emerick Rogul 134c0e714d Add new teardown step in TestingBraveBrowserProcess
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/20ec0e9bb3a97a4ff84f91fb9b0b4ff6d5082ac2

commit 20ec0e9bb3a97a4ff84f91fb9b0b4ff6d5082ac2
Author: Nasser Al-shawwa <alshawwa@chromium.org>
Date:   Wed Apr 19 21:14:07 2023 +0000

    Add teardown step before DeleteInstance in TestingBrowserProcess

    Validate-Test-Flakiness: skip
    Bug: b/274807136
2023-05-15 11:02:31 -04:00
Mark Pilgrim 19e0b7e863 Implement Request Off-The-Record (#17365)
* Implement Request Off-The-Record

* feedback

* patch upstream bug

* add tests for window.open blocking

* feedback
2023-05-05 00:38:20 +02:00
sergei 07ea8b5880 Fix tests 2023-04-18 16:04:30 +03:00
Darnell Andries 38143b2049 Remove BraveP3A prefix from P3A classes, renamed 'brave' namespace to 'p3a' 2023-04-03 12:20:49 -07:00
Darnell Andries 8f0437317f Add support for ephemeral P3A metrics, add ads enabled installation time metric 2023-03-10 13:42:45 -08:00
Emerick Rogul 7d7bca1cef bind.h, callback{,_forward,_helpers}.h now located in //base/functionality
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/cd23b8b9d212daf06dde638488dbaa355d6651fa

commit cd23b8b9d212daf06dde638488dbaa355d6651fa
Author: Daniel Cheng <dcheng@chromium.org>
Date:   Fri Sep 16 17:16:24 2022 +0000

    Move bind.h, callback{,_forward,_helpers}.h into //base/functional

    Forwarding headers remain in the old locations to ease migration.
    Include paths for files in //base/functional/ are also fixed up to the
    new canonical path; remaining fixups are deferred until followups to
    minimize the risk of conflicts.

    Bug: 1364441
2023-02-22 06:29:17 -05:00
Arthur Edelstein 98b811e1ae HTTPS by default for Desktop (#16521)
HTTPS by default on Desktop

- Disabled, Standard, Strict modes
- Controlled by global and per-site shields settings
- Merge UI with HTTPS-Only Mode
- Behind HttpsByDefault feature flag
- Browser tests for each setting
2023-02-08 07:00:54 -05:00
Darnell Andries c08a58fafb Add desktop menu dismiss rate P3A metric 2023-01-16 12:45:40 -08:00
Darnell Andries 005c1ec55c Transfer ownership of MenuMetrics to browser process 2023-01-16 12:42:04 -08:00
Simon Hong a1ed9eb3e9 Merge pull request #16384 from brave/issue_27395
Update local prefs & url loader factory to BraveVPNOSConnectionAPI setting timing
2023-01-12 08:05:01 +09:00
Ivan Efremov bc562467e0 Drop the extenion whitelist and its deps altogether.
Resolves https://github.com/brave/brave-browser/issues/27613
2023-01-04 17:30:00 +07:00
Simon Hong daf055c6aa Avoid complicated buildflag checking
By providing nullptr for OSConnectionAPI and moving create
method to platform specific files, we can avoid complicted buildflag
condition checking at BraveBrowserProcessImpl.
2023-01-04 13:02:47 +09:00
Simon Hong 595503dc2e Made browser process own vpn os connection api
With this change, we don't need to worry to use connection api before
initialized.
2023-01-04 11:36:29 +09:00
Anthony Tseng cfc13ca576 Remove SessionProfile leftover completely 2022-10-17 15:19:03 -07:00
cepera df4cf3ab9f Added URL Sanitizer service and Copy Clean URL item for links 2022-09-01 08:12:30 +03:00
Claudio DeSouza 2987acef1e [CodeHealth] Clang tidy browser with use-equals-default V
This change corrects the constructors of several classes under
browser/, using clang-tidy's modernize-use-equals-default. Additionally,
this commit includes a few additional straggler files.
2022-08-17 15:48:08 +01:00
Pavel Beloborodov 2398b3e89c Tor bridges support [Client part] (#13290)
* Explicit sandbox attribute for TorLauncher instead of specialization of the GetServiceSandboxType<>
* Added tor.bridges local state pref.
* Added component updater for Tor Pluggable transports.
* Reworked Tor browser test.
* Added Tor bridges tests
* Tor settings moved to Privacy page.
* Tor new tab page description and failure messages were added.
2022-08-03 20:43:18 +07:00
Simon Hong d18b611d89 Turned on closing window dialog by default
fix https://github.com/brave/brave-browser/issues/23056
2022-06-02 22:43:10 +09:00
Mikhail 6387cfd7d4 Move a part of //brave/common to //brave/components (#13456)
* Move a part of //brave/common to //brave/components

* Fix lint issues

* Remove brave_features.*

* Fix android build

* Remove dead includes

* fix compilation

* Fix review issues

* Fix android gn check

* Revert patch changes

* Fix deps duplication & copyright

* Fix some DEPS/BUILD.gn contradictions

* gn format

* move sources.gni

* Fix nits

* Fix after rebase
2022-05-27 16:44:18 +07:00
Claudio DeSouza e6766cd819 Correcting BraveUnitTestSuite instantiation
Recent changes to content::UnitTestTestSuite have been added to provide
support to ContentClient instantiations. This addition might have to
potential to remove the individual instantiation of those in each
browser test fixture. This CL corrects the build breakage introduced by
this change.

Chromium change:
https://chromium.googlesource.com/chromium/src/+/d2126c70ea1b9cc77a07293790027af8d3fb612e

commit d2126c70ea1b9cc77a07293790027af8d3fb612e
Author: John Abd-El-Malek <jam@chromium.org>
Date:   Fri Mar 25 10:25:12 2022 +0000

    Move initialization and tear down of objects needed by Content and its dependencies into content::UnitTestTestSuite.

    This avoids test suites which depend on content having to duplicate this correctly. It also allows UnitTestTestSuite to ask embedders to create ContentClient implementations at the right time, which will soon be needed before calling blink::Initialize.

    Bug: 1309246
2022-05-13 18:01:38 +01:00
Mark Pilgrimandbridiver f6dddf29d8 Implement "reduce language fingerprinting" (#12234)
* Implement navigator.languages farbling

* add support for HTTP headers

* add support for farbling HTTP header

* add reduce language preference toggle in settings

* Implement font whitelist

* add sublabel to reduce-lang preference toggle

* rebase patches

* use anonymous namespace

* also add our AllowFontFamily method to TestFontSelector to avoid compile errors

* farble all non-whitelisted fonts without enumeration

* rename to MakePseudoRandomGeneratorForURL

* move session token management to singleton service

* move font whitelist to .cc file

* move prefs constants and code around

* pref names browsertest fix

* reduce patches (really)

* add web worker and service worker tests

* get URL differently, move DCHECK

* propogate reduce-language pref to renderers

* consolidate feature detection, add some comments

* lint

* gn_check

* gn_check

* refactor default locale lookup

* lint

* default session key to 12345 if command line switch is missing
https://github.com/brave/brave-browser/issues/22021

* change 12345 -> 23456 so it doesn’t match the test default

Co-authored-by: bridiver <github@brianjohnson.cc>
2022-03-31 13:41:44 -04:00
Mario Sanchez Prada 463696b213 Fix Lint issues 2022-03-22 18:58:14 +01:00
Mario Sanchez Prada 7d7f5e7554 Added missing includes for build/build_config.h 2022-03-22 10:57:30 +01:00
Mario Sanchez Prada f4c7bdda37 Migrate define(OS_*) to using BUILDFLAG(IS_*) instead
See the following PSA in the chromium-dev mailing list for more
information and links to the original discussion, the design
document and the metabug:

https://groups.google.com/a/chromium.org/g/chromium-dev/c/EIuQCy9sVfw/m/Net3FPz6AwAJ

Resolves https://github.com/brave/brave-browser/issues/21608
2022-03-22 10:57:30 +01:00
Anton Lazarev 7648cba738 fix tests 2022-02-17 12:52:31 -08:00
Mario Sanchez Prada bbf5fd3fe9 Remove deprecated DISALLOW_ macros from Brave-specific code
Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900
per style arbitration [1]. This commit replaces the macros with deleted
constructors and methods, which is preferred by the Google C++ Style
Guide [2][3].

Also remove unneeded "base/macros.h" #includes when possible.

This CL is created semi-mechanically with remove_disallow and
remove_base_macros [4].

[1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ
[2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
[3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types
[4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb

commit d002a3bee7ae75780b604d17df19291a3dd303fb
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 5 17:17:19 2021 +0000

    Remove DISALLOW_ macros from base/macros.h

    This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
    DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
    updated to no longer check for these macros.

    IWYU removal is left as a separate change just in case this needs to be
    reverted.

    Bug: 1010217
2022-01-24 15:33:37 -05:00