Ensure incognito TestingProfiles are incognito for their whole lifetime.
Otherwise keyed services see different profiles in unit_tests at
different times since the incognito->GetOriginalProfile() changes. This
is causing release code to pick up unnecessary workarounds to keep
unit_tests green in try runs.
The fix is achieved by adding `TestingProfile::Builder::BuildIncognito`,
which differs from `Build` by requiring an |original_profile| argument,
which will own the incognito profile (so no need to return scoped_ptr).
This simplifies a lot of call sites, since they no longer need to do a
scoped_ptr dance of their own.
BUG=277296
Review URL: https://codereview.chromium.org/556173002
Cr-Commit-Position: refs/heads/master@{#294931}
15 files changed