diff --git a/AUTHORS b/AUTHORS index e24dd518dd..c85a4e8764 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Cody Barnes Colin Plumb David Porter Dax Booysen +Danail Kirov Dmitry Lizin Eric Rescorla, RTFM Inc. Frederik Riedel, Frogg GmbH diff --git a/test/run_loop.cc b/test/run_loop.cc index dc2ec18eea..052662a464 100644 --- a/test/run_loop.cc +++ b/test/run_loop.cc @@ -14,7 +14,7 @@ namespace webrtc { namespace test { -void PressEnterToContinue() { +void PressEnterToContinue(SingleThreadedTaskQueueForTesting&) { puts(">> Press ENTER to continue..."); while (getc(stdin) != '\n' && !feof(stdin)) ; diff --git a/test/run_loop.h b/test/run_loop.h index 90063dc3e8..36bfa06697 100644 --- a/test/run_loop.h +++ b/test/run_loop.h @@ -10,11 +10,13 @@ #ifndef TEST_RUN_LOOP_H_ #define TEST_RUN_LOOP_H_ +#include "test/single_threaded_task_queue.h" + namespace webrtc { namespace test { // Blocks until the user presses enter. -void PressEnterToContinue(); +void PressEnterToContinue(SingleThreadedTaskQueueForTesting &task_queue); } // namespace test } // namespace webrtc diff --git a/test/win/run_loop_win.cc b/test/win/run_loop_win.cc index 28dc9334e0..ee936358fa 100644 --- a/test/win/run_loop_win.cc +++ b/test/win/run_loop_win.cc @@ -18,15 +18,18 @@ namespace webrtc { namespace test { -void PressEnterToContinue() { +void PressEnterToContinue(SingleThreadedTaskQueueForTesting &task_queue) { puts(">> Press ENTER to continue..."); - MSG msg; - BOOL ret; - while ((ret = GetMessage(&msg, NULL, 0, 0)) != 0) { - assert(ret != -1); - TranslateMessage(&msg); - DispatchMessage(&msg); + while (!_kbhit() || _getch() != '\r') { + // Drive the message loop for the thread running the task_queue + task_queue.SendTask([&]() { + MSG msg; + if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + }); } } } // namespace test diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index 964e918989..15579d855b 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -1381,7 +1381,7 @@ void VideoQualityTest::RunWithRenderers(const Params& params) { Start(); }); - test::PressEnterToContinue(); + test::PressEnterToContinue(task_queue_); task_queue_.SendTask([&]() { Stop();