Commit fa14f778 authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

VR: Use new RunFor() helpers everywhere in UI unittests

BUG=
R=tiborg

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2db855f4a560e521537c5016f564aee69edc0073
Reviewed-on: https://chromium-review.googlesource.com/1007632Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550177}
parent 256e6c0d
...@@ -93,7 +93,6 @@ class UiTest : public testing::Test { ...@@ -93,7 +93,6 @@ class UiTest : public testing::Test {
// then jumping time ahead to the final time. Generally, the UI should not // then jumping time ahead to the final time. Generally, the UI should not
// require all intermediate frames to be called. Tests that require this // require all intermediate frames to be called. Tests that require this
// should simulate the required intermediate frames. // should simulate the required intermediate frames.
bool RunFor(base::TimeDelta delta);
bool RunForMs(float milliseconds); bool RunForMs(float milliseconds);
bool RunForSeconds(float seconds); bool RunForSeconds(float seconds);
...@@ -114,6 +113,8 @@ class UiTest : public testing::Test { ...@@ -114,6 +113,8 @@ class UiTest : public testing::Test {
UiScene* scene_ = nullptr; UiScene* scene_ = nullptr;
private: private:
bool RunFor(base::TimeDelta delta);
base::TimeTicks current_time_; base::TimeTicks current_time_;
}; };
......
...@@ -398,7 +398,7 @@ TEST_F(UiInputManagerTest, HitTestStrategy) { ...@@ -398,7 +398,7 @@ TEST_F(UiInputManagerTest, HitTestStrategy) {
} }
TEST_F(UiInputManagerContentTest, NoMouseMovesDuringClick) { TEST_F(UiInputManagerContentTest, NoMouseMovesDuringClick) {
EXPECT_TRUE(RunFor(MsToDelta(500))); EXPECT_TRUE(RunForMs(500));
// It would be nice if the controller weren't platform specific and we could // It would be nice if the controller weren't platform specific and we could
// mock out the underlying sensor data. For now, we will hallucinate // mock out the underlying sensor data. For now, we will hallucinate
// parameters to HandleInput. // parameters to HandleInput.
...@@ -432,7 +432,7 @@ TEST_F(UiInputManagerContentTest, NoMouseMovesDuringClick) { ...@@ -432,7 +432,7 @@ TEST_F(UiInputManagerContentTest, NoMouseMovesDuringClick) {
TEST_F(UiInputManagerContentTest, AudioPermissionPromptHitTesting) { TEST_F(UiInputManagerContentTest, AudioPermissionPromptHitTesting) {
model_->active_modal_prompt_type = model_->active_modal_prompt_type =
kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission; kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission;
EXPECT_TRUE(RunFor(MsToDelta(500))); EXPECT_TRUE(RunForMs(500));
UiElement* url_bar = scene_->GetUiElementByName(UiElementName::kUrlBar); UiElement* url_bar = scene_->GetUiElementByName(UiElementName::kUrlBar);
gfx::Point3F url_bar_center = url_bar->GetCenter(); gfx::Point3F url_bar_center = url_bar->GetCenter();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment