mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Internal change
PiperOrigin-RevId: 371332999
This commit is contained in:
@@ -34,6 +34,9 @@ class FeatureFlags {
|
||||
// If a scheduled runnable is already running, Cancel() will synchronously
|
||||
// wait for the task to complete.
|
||||
bool cancel_waits_for_running_tasks = true;
|
||||
// Keep Alive frame interval and timeout in millis.
|
||||
std::int32_t keep_alive_interval_millis = 5000;
|
||||
std::int32_t keep_alive_timeout_millis = 30000;
|
||||
};
|
||||
|
||||
static const FeatureFlags& GetInstance() {
|
||||
|
||||
@@ -21,13 +21,18 @@ namespace location {
|
||||
namespace nearby {
|
||||
namespace {
|
||||
|
||||
constexpr FeatureFlags::Flags kTestFeatureFlags{.enable_cancellation_flag =
|
||||
true};
|
||||
constexpr FeatureFlags::Flags kTestFeatureFlags{
|
||||
.enable_cancellation_flag = true,
|
||||
.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_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);
|
||||
|
||||
Reference in New Issue
Block a user