#ifndef CHROME_BROWSER_VR_TEST_UI_UTILS_H_
#define CHROME_BROWSER_VR_TEST_UI_UTILS_H_
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "chrome/browser/vr/ui_test_input.h"
namespace vr {
class BrowserRenderer;
class VRBrowserRendererThread;
class UiUtils {
public:
static constexpr int kDefaultUiQuiescenceTimeout = 2000;
static std::unique_ptr<UiUtils> Create();
UiUtils();
UiUtils(const UiUtils&) = delete;
UiUtils& operator=(const UiUtils&) = delete;
~UiUtils();
void WaitForVisibilityStatus(const UserFriendlyElementName& element_name,
const bool& visible);
static void DisableOverlayForTesting();
private:
static void PollForBrowserRenderer(base::RunLoop* wait_loop);
static VRBrowserRendererThread* GetRendererThread();
static BrowserRenderer* GetBrowserRenderer();
void WatchElementForVisibilityStatusForTesting(
std::optional<UiVisibilityState> visibility_expectation);
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
};
}
#endif