| Index: ash/wm/lock_state_controller_unittest.cc
|
| diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc
|
| index 2ab2532bd4e918b211997af34a3f2a2043c907d3..d23035f47c1404b278bb4d687124f2cca82e6f09 100644
|
| --- a/ash/wm/lock_state_controller_unittest.cc
|
| +++ b/ash/wm/lock_state_controller_unittest.cc
|
| @@ -19,6 +19,9 @@
|
| #include "ash/wm/power_button_controller.h"
|
| #include "ash/wm/session_state_animator.h"
|
| #include "base/memory/scoped_vector.h"
|
| +#include "base/run_loop.h"
|
| +#include "base/task_runner.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/fake_session_manager_client.h"
|
| @@ -32,6 +35,8 @@ namespace ash {
|
| namespace test {
|
| namespace {
|
|
|
| +const int kWaitVolumeSliderHiddenInMs = 200;
|
| +
|
| bool cursor_visible() {
|
| return Shell::GetInstance()->cursor_manager()->IsCursorVisible();
|
| }
|
| @@ -41,6 +46,14 @@ void CheckCalledCallback(bool* flag) {
|
| (*flag) = true;
|
| }
|
|
|
| +void WaitUntilVolumeSliderHidden() {
|
| + base::RunLoop run_loop;
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE, run_loop.QuitClosure(),
|
| + base::TimeDelta::FromMilliseconds(kWaitVolumeSliderHiddenInMs));
|
| + run_loop.Run();
|
| +}
|
| +
|
| } // namespace
|
|
|
| class LockStateControllerTest : public AshTestBase {
|
| @@ -1050,6 +1063,7 @@ TEST_F(LockStateControllerTest, Screenshot) {
|
| PressPowerButton();
|
| ReleasePowerButton();
|
| ReleaseVolumeDown();
|
| + WaitUntilVolumeSliderHidden();
|
| EXPECT_EQ(1, delegate->handle_take_screenshot_count());
|
| }
|
|
|
|
|