16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKFOCUSMANAGEROBSERVER_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKFOCUSMANAGEROBSERVER_H_ 25 #include <condition_variable> 29 namespace sdkInterfaces {
53 bool waitForFocusChanges(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero());
58 std::condition_variable m_conditionVariable;
65 std::lock_guard<std::mutex> lock(m_mutex);
68 std::lock_guard<std::mutex> lock(m_mutex);
70 m_conditionVariable.notify_all();
76 std::unique_lock<std::mutex> lock(m_mutex);
77 return m_conditionVariable.wait_for(lock, timeout, [
this] {
return !m_expects; });
85 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKFOCUSMANAGEROBSERVER_H_ void expectFocusChange(const std::string &channelName, avs::FocusState newFocus)
Definition: MockFocusManagerObserver.h:64
An interface that clients can extend to register to observe focus changes.
Definition: FocusManagerObserverInterface.h:26
Definition: AmdMetricWrapperTest.cpp:24
::std::string string
Definition: gtest-port.h:1097
virtual void onFocusChanged(const std::string &channelName, avsCommon::avs::FocusState newFocus)=0
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
Definition: gmock-actions.h:1168
FocusState
Definition: FocusState.h:29
MOCK_METHOD2(onFocusChanged, void(const std::string &channelName, avs::FocusState newFocus))
MockFocusManagerObserver()
Definition: MockFocusManagerObserver.h:61
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
#define EXPECT_CALL(obj, call)
Definition: gmock-spec-builders.h:1845
bool waitForFocusChanges(std::chrono::milliseconds timeout=std::chrono::milliseconds::zero())
Definition: MockFocusManagerObserver.h:75
PolymorphicMatcher< internal::StrEqualityMatcher< internal::string > > StrEq(const internal::string &str)
Definition: gmock-matchers.h:3955
Mock class that implements the FocusManagerObserver.
Definition: MockFocusManagerObserver.h:33