Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly call TestingProfile::Builder::SetIsNewProfile() from tests
Before Chromium 90, both TestingProfile and TestingProfile::Builder did use base::Optional<bool> for their internal |is_new_profile| attribute, and calling TestingProfile::IsNewProfile() without having explicitly provided a value for |is_new_profile| via OverrideIsNewProfile() would result on returning the value returned by Profile::IsNewProfile(): bool TestingProfile::IsNewProfile() const { if (is_new_profile_.has_value()) return is_new_profile_.value(); return Profile::IsNewProfile(); } But now that Profile::IsNewProfile() is a pure virtual function, the |is_new_profile| attribute of TestingProfile is no longer an optional value, but a bool initialized to false. Therefore, it is now mandatory to initialize its counterpart in TestingProfile::Builder explicitly in order to make it clear that we're building a new testing profile. Chromium change: https://chromium.googlesource.com/chromium/src.git/+/52208fa33df1dc2174fb044cf777eeecad38838d commit 52208fa33df1dc2174fb044cf777eeecad38838d Author: Glen Robertson <[email protected]> Date: Fri Jan 15 07:10:38 2021 +0000 Push Profile::IsNewProfile down to subclasses, remove dep on first_run. TestingProfile::IsNewProfile now defaults to false instead of defaulting to the impl's behaviour when not overridden. profile.cc's inclusion of first_run.h was its last dependency on //c/b/... except for constants that have separate GN targets, and profile_observer. Removing the dependency allows profile.{cc,h} and profile_observer.h to be moved from //c/b:browser to a separate GN target (will be done in subsequent CL). This will let us break dependency cycles and improve modularization of the codebase. Bug: 1149277
- Loading branch information