mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Enable cancellation flag support by default
PiperOrigin-RevId: 524329836
This commit is contained in:
committed by
Copybara-Service
parent
00bba36219
commit
6cdc9890b5
@@ -26,7 +26,7 @@ class FeatureFlags {
|
||||
public:
|
||||
// Holds for all the feature flags.
|
||||
struct Flags {
|
||||
bool enable_cancellation_flag = false;
|
||||
bool enable_cancellation_flag = true;
|
||||
bool enable_async_bandwidth_upgrade = true;
|
||||
// If a scheduled runnable is already running, Cancel() will synchronously
|
||||
// wait for the task to complete.
|
||||
|
||||
@@ -21,23 +21,23 @@ namespace nearby {
|
||||
namespace {
|
||||
|
||||
constexpr FeatureFlags::Flags kTestFeatureFlags{
|
||||
.enable_cancellation_flag = true,
|
||||
.enable_cancellation_flag = false,
|
||||
.keep_alive_interval_millis = 5000,
|
||||
.keep_alive_timeout_millis = 30000};
|
||||
|
||||
TEST(FeatureFlagsTest, ToSetFeatureWorks) {
|
||||
const FeatureFlags& features = FeatureFlags::GetInstance();
|
||||
EXPECT_FALSE(features.GetFlags().enable_cancellation_flag);
|
||||
EXPECT_TRUE(features.GetFlags().enable_cancellation_flag);
|
||||
|
||||
EXPECT_EQ(5000, features.GetFlags().keep_alive_interval_millis);
|
||||
EXPECT_EQ(30000, features.GetFlags().keep_alive_timeout_millis);
|
||||
|
||||
MediumEnvironment& medium_environment = MediumEnvironment::Instance();
|
||||
medium_environment.SetFeatureFlags(kTestFeatureFlags);
|
||||
EXPECT_TRUE(features.GetFlags().enable_cancellation_flag);
|
||||
EXPECT_FALSE(features.GetFlags().enable_cancellation_flag);
|
||||
|
||||
const FeatureFlags& another_features_ref = FeatureFlags::GetInstance();
|
||||
EXPECT_TRUE(another_features_ref.GetFlags().enable_cancellation_flag);
|
||||
EXPECT_FALSE(another_features_ref.GetFlags().enable_cancellation_flag);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user