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 @@ ...@@ -41,11 +41,6 @@
namespace extensions { namespace extensions {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
const base::Feature kExtensionsAllAccountsFeature{
"ExtensionsAllAccounts", base::FEATURE_ENABLED_BY_DEFAULT};
#endif
IdentityTokenCacheValue::IdentityTokenCacheValue() IdentityTokenCacheValue::IdentityTokenCacheValue()
: status_(CACHE_STATUS_NOTFOUND) {} : status_(CACHE_STATUS_NOTFOUND) {}
...@@ -155,13 +150,7 @@ BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { ...@@ -155,13 +150,7 @@ BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() {
} }
bool IdentityAPI::AreExtensionsRestrictedToPrimaryAccount() { bool IdentityAPI::AreExtensionsRestrictedToPrimaryAccount() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT) return !AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_);
if (!AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_))
return true;
return !base::FeatureList::IsEnabled(kExtensionsAllAccountsFeature);
#else
return true;
#endif
} }
void IdentityAPI::OnRefreshTokenUpdatedForAccount( void IdentityAPI::OnRefreshTokenUpdatedForAccount(
......
...@@ -42,11 +42,6 @@ class Profile; ...@@ -42,11 +42,6 @@ class Profile;
namespace extensions { namespace extensions {
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
// Enables all accounts in extensions.
extern const base::Feature kExtensionsAllAccountsFeature;
#endif
class IdentityTokenCacheValue { class IdentityTokenCacheValue {
public: public:
IdentityTokenCacheValue(); IdentityTokenCacheValue();
......
...@@ -17,25 +17,19 @@ namespace extensions { ...@@ -17,25 +17,19 @@ namespace extensions {
// Tests that all accounts in extensions is enabled when Dice is enabled. // Tests that all accounts in extensions is enabled when Dice is enabled.
TEST(IdentityApiTest, DiceAllAccountsExtensions) { TEST(IdentityApiTest, DiceAllAccountsExtensions) {
content::BrowserTaskEnvironment task_environment; content::BrowserTaskEnvironment task_environment;
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(kExtensionsAllAccountsFeature);
TestingProfile profile; TestingProfile profile;
IdentityAPI api(&profile); IdentityAPI api(&profile);
EXPECT_FALSE(api.AreExtensionsRestrictedToPrimaryAccount()); EXPECT_FALSE(api.AreExtensionsRestrictedToPrimaryAccount());
api.Shutdown(); api.Shutdown();
} }
#endif #else
TEST(IdentityApiTest, AllAccountsExtensionDisabled) { TEST(IdentityApiTest, AllAccountsExtensionDisabled) {
content::BrowserTaskEnvironment task_environment; content::BrowserTaskEnvironment task_environment;
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(kExtensionsAllAccountsFeature);
#endif
TestingProfile profile; TestingProfile profile;
IdentityAPI api(&profile); IdentityAPI api(&profile);
EXPECT_TRUE(api.AreExtensionsRestrictedToPrimaryAccount()); EXPECT_TRUE(api.AreExtensionsRestrictedToPrimaryAccount());
api.Shutdown(); api.Shutdown();
} }
#endif
} // namespace extensions } // namespace extensions
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "build/buildflag.h" #include "build/buildflag.h"
...@@ -510,11 +509,7 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest { ...@@ -510,11 +509,7 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest {
class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin { class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin {
public: public:
IdentityGetAccountsFunctionTest() { IdentityGetAccountsFunctionTest() = default;
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
feature_list_.InitAndEnableFeature(kExtensionsAllAccountsFeature);
#endif
}
protected: protected:
testing::AssertionResult ExpectGetAccounts( testing::AssertionResult ExpectGetAccounts(
...@@ -582,9 +577,6 @@ class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin { ...@@ -582,9 +577,6 @@ class IdentityGetAccountsFunctionTest : public IdentityTestWithSignin {
return testing::AssertionFailure(msg); return testing::AssertionFailure(msg);
} }
private:
base::test::ScopedFeatureList feature_list_;
}; };
IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, AllAccountsOn) { IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, AllAccountsOn) {
...@@ -628,32 +620,6 @@ IN_PROC_BROWSER_TEST_F(IdentityGetAccountsFunctionTest, TwoAccountsSignedIn) { ...@@ -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 { class IdentityGetProfileUserInfoFunctionTest : public IdentityTestWithSignin {
protected: protected:
std::unique_ptr<api::identity::ProfileUserInfo> RunGetProfileUserInfo() { std::unique_ptr<api::identity::ProfileUserInfo> RunGetProfileUserInfo() {
...@@ -718,11 +684,7 @@ class GetAuthTokenFunctionTest ...@@ -718,11 +684,7 @@ class GetAuthTokenFunctionTest
: public IdentityTestWithSignin, : public IdentityTestWithSignin,
public signin::IdentityManager::DiagnosticsObserver { public signin::IdentityManager::DiagnosticsObserver {
public: public:
GetAuthTokenFunctionTest() { GetAuthTokenFunctionTest() = default;
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
feature_list_.InitAndEnableFeature(kExtensionsAllAccountsFeature);
#endif
}
std::string IssueLoginAccessTokenForAccount(const CoreAccountId& account_id) { std::string IssueLoginAccessTokenForAccount(const CoreAccountId& account_id) {
std::string access_token = "access_token-" + account_id.id; std::string access_token = "access_token-" + account_id.id;
...@@ -823,7 +785,6 @@ class GetAuthTokenFunctionTest ...@@ -823,7 +785,6 @@ class GetAuthTokenFunctionTest
std::move(on_access_token_requested_).Run(); std::move(on_access_token_requested_).Run();
} }
base::test::ScopedFeatureList feature_list_;
std::string extension_id_; std::string extension_id_;
std::set<std::string> oauth_scopes_; 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