[Nearby Connections] Enable Cancellation Flags

Re-enables Cancellation Flags once fixes for crashes caused by destroying the cancellation flags that are being consumed by other classes have landed.

PiperOrigin-RevId: 543857192
This commit is contained in:
Juliet Levesque
2023-06-27 14:46:19 -07:00
committed by Copybara-Service
parent a35b3c1bf1
commit 34128a35de
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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.
+4 -4
View File
@@ -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