mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Merge branch 'google3' to roll forward up to cl/355791747.
This commit is contained in:
@@ -14,6 +14,10 @@ class FeatureFlags {
|
||||
struct Flags {
|
||||
bool enable_cancellation_flag = false;
|
||||
bool resume_before_disconnect = true;
|
||||
// Disable ServiceController API (using StoppableServiceController) when
|
||||
// ServiceController is released to prevent calls to that API from
|
||||
// other threads.
|
||||
bool disable_released_service_controller = true;
|
||||
};
|
||||
|
||||
static const FeatureFlags& GetInstance() {
|
||||
|
||||
@@ -38,6 +38,8 @@ class AtomicBoolean final : public api::AtomicBoolean {
|
||||
bool Get() const override { return impl_->Get(); }
|
||||
bool Set(bool value) override { return impl_->Set(value); }
|
||||
|
||||
explicit operator bool() const { return Get(); }
|
||||
|
||||
private:
|
||||
std::unique_ptr<api::AtomicBoolean> impl_;
|
||||
};
|
||||
|
||||
@@ -33,6 +33,17 @@ TEST(AtomicBooleanTest, GetReturnsWhatWasSet) {
|
||||
EXPECT_TRUE(value.Get());
|
||||
}
|
||||
|
||||
TEST(AtomicBooleanTest, ImplicitGetTrueValue) {
|
||||
AtomicBoolean value(true);
|
||||
|
||||
EXPECT_TRUE(value);
|
||||
}
|
||||
|
||||
TEST(AtomicBooleanTest, ImplicitGetFalseValue) {
|
||||
AtomicBoolean value(false);
|
||||
|
||||
EXPECT_FALSE(value);
|
||||
}
|
||||
} // namespace
|
||||
} // namespace nearby
|
||||
} // namespace location
|
||||
|
||||
Reference in New Issue
Block a user