Commit 5a127bca authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Delete kExtensionsAllAccountsFeature

This feature has been enabled by default for some time and is no longer
needed.

Change-Id: I6b0ce810f3177114cf3575866713014411c06982
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932901Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719173}
parent 3b83f716
......@@ -41,11 +41,6 @@
namespace extensions {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
const base::Feature kExtensionsAllAccountsFeature{
"ExtensionsAllAccounts", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
IdentityTokenCacheValue::IdentityTokenCacheValue()
: status_(CACHE_STATUS_NOTFOUND) {}
......@@ -155,13 +150,7 @@ BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() {
}
bool IdentityAPI::AreExtensionsRestrictedToPrimaryAccount() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
if (!AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_))
return true;
return !base::FeatureList::IsEnabled(kExtensionsAllAccountsFeature);
#else
return true;
#endif
return !AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_);
}
void IdentityAPI::OnRefreshTokenUpdatedForAccount(
......
......@@ -42,11 +42,6 @@ class Profile;
namespace extensions {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
// Enables all accounts in extensions.
extern const base::Feature kExtensionsAllAccountsFeature;
#endif
class IdentityTokenCacheValue {
public:
IdentityTokenCacheValue();
......
......@@ -17,25 +17,19 @@ namespace extensions {
// Tests that all accounts in extensions is enabled when Dice is enabled.
TEST(IdentityApiTest, DiceAllAccountsExtensions) {
content::BrowserTaskEnvironment task_environment;
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(kExtensionsAllAccountsFeature);
TestingProfile profile;
IdentityAPI api(&profile);
EXPECT_FALSE(api.AreExtensionsRestrictedToPrimaryAccount());
api.Shutdown();
}
#endif
#else
TEST(IdentityApiTest, AllAccountsExtensionDisabled) {
content::BrowserTaskEnvironment task_environment;
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(kExtensionsAllAccountsFeature);
#endif
TestingProfile profile;
IdentityAPI api(&profile);
EXPECT_TRUE(api.AreExtensionsRestrictedToPrimaryAccount());
api.Shutdown();
}
#endif
} // namespace extensions
......@@ -13,7 +13,6 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/buildflag.h"
......@@ -510,11 +509,7 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest {
class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin {
public:
IdentityGetAccountsFunctionTest() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
feature_list_.InitAndEnableFeature(kExtensionsAllAccountsFeature);
#endif
}
IdentityGetAccountsFunctionTest() = default;
protected:
testing::AssertionResult ExpectGetAccounts(
......@@ -582,9 +577,6 @@ class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin {
return testing::AssertionFailure(msg);
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, AllAccountsOn) {
......@@ -628,32 +620,6 @@ IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, TwoAccountsSignedIn) {
}
}
class IdentityOldProfilesGetAccountsFunctionTest
: public IdentityGetAccountsFunctionTest {
public:
IdentityOldProfilesGetAccountsFunctionTest() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
// Disable the feature that was enabled by the parent class.
feature_list_.InitAndDisableFeature(kExtensionsAllAccountsFeature);
#endif
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest,
AllAccountsOff) {
EXPECT_TRUE(id_api()->AreExtensionsRestrictedToPrimaryAccount());
}
IN_PROC_BROWSER_TEST_F(IdentityOldProfilesGetAccountsFunctionTest,
TwoAccountsSignedIn) {
SignIn("primary@example.com");
identity_test_env()->MakeAccountAvailable("secondary@example.com");
EXPECT_TRUE(ExpectGetAccounts({"gaia_id_for_primary_example.com"}));
}
class IdentityGetProfileUserInfoFunctionTest : public IdentityTestWithSignin {
protected:
std::unique_ptr<api::identity::ProfileUserInfo> RunGetProfileUserInfo() {
......@@ -718,11 +684,7 @@ class GetAuthTokenFunctionTest
: public IdentityTestWithSignin,
public signin::IdentityManager::DiagnosticsObserver {
public:
GetAuthTokenFunctionTest() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
feature_list_.InitAndEnableFeature(kExtensionsAllAccountsFeature);
#endif
}
GetAuthTokenFunctionTest() = default;
std::string IssueLoginAccessTokenForAccount(const CoreAccountId& account_id) {
std::string access_token = "access_token-" + account_id.id;
......@@ -823,7 +785,6 @@ class GetAuthTokenFunctionTest
std::move(on_access_token_requested_).Run();
}
base::test::ScopedFeatureList feature_list_;
std::string extension_id_;
std::set<std::string> oauth_scopes_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment