| Index: chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
|
| diff --git a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
|
| index 38b82414712b3d60651a222fd83c09b15bff338c..fc142a2a59446b6d2109390607d45f07893e1d07 100644
|
| --- a/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
|
| +++ b/chrome/browser/android/vr_shell/ui_scene_manager_unittest.cc
|
| @@ -6,7 +6,8 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ptr_util.h"
|
| -#include "base/test/scoped_task_environment.h"
|
| +#include "base/message_loop/message_loop.h"
|
| +#include "base/test/scoped_mock_time_message_loop_task_runner.h"
|
| #include "chrome/browser/android/vr_shell/ui_browser_interface.h"
|
| #include "chrome/browser/android/vr_shell/ui_elements/ui_element.h"
|
| #include "chrome/browser/android/vr_shell/ui_elements/ui_element_debug_id.h"
|
| @@ -102,7 +103,7 @@ class UiSceneManagerTest : public testing::Test {
|
| return true;
|
| }
|
|
|
| - base::test::ScopedTaskEnvironment scoped_task_environment_;
|
| + base::MessageLoop message_loop_;
|
| std::unique_ptr<MockBrowserInterface> browser_;
|
| std::unique_ptr<UiScene> scene_;
|
| std::unique_ptr<UiSceneManager> manager_;
|
| @@ -148,6 +149,21 @@ TEST_F(UiSceneManagerTest, WebVrWarningsDoNotShowWhenInitiallyOutsideWebVr) {
|
| EXPECT_TRUE(IsVisible(kWebVrTransientHttpSecurityWarning));
|
| }
|
|
|
| +TEST_F(UiSceneManagerTest, WebVrTransientWarningTimesOut) {
|
| + base::ScopedMockTimeMessageLoopTaskRunner task_runner_;
|
| +
|
| + MakeManager(kNotInCct, kInWebVr);
|
| + EXPECT_TRUE(IsVisible(kWebVrTransientHttpSecurityWarning));
|
| +
|
| + // Note: Fast-forwarding appears broken in conjunction with restarting timers.
|
| + // In this test, we can fast-forward by the appropriate time interval, but in
|
| + // other cases (until the bug is addressed), we could work around the problem
|
| + // by using FastForwardUntilNoTasksRemain() instead.
|
| + // See http://crbug.com/736558.
|
| + task_runner_->FastForwardBy(base::TimeDelta::FromSeconds(31));
|
| + EXPECT_FALSE(IsVisible(kWebVrTransientHttpSecurityWarning));
|
| +}
|
| +
|
| TEST_F(UiSceneManagerTest, ToastVisibility) {
|
| // Tests toast not showing when directly entering VR though WebVR
|
| // presentation.
|
|
|