blob: 93bd90da06ea315136158386eecda969bd87d69c [file] [log] [blame]
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
Yves Gerey665174f2018-06-19 15:03:05 +020010#include <Windows.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020011#include <assert.h>
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000012#include <conio.h>
13#include <stdio.h>
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000014
Danil Chapovalov82a3f0a2019-10-21 09:24:27 +020015#include "rtc_base/task_queue_for_test.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020016#include "test/run_loop.h"
17
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000018namespace webrtc {
19namespace test {
20
Yves Gerey6516f762019-08-29 11:50:23 +020021void PressEnterToContinue(
22 DEPRECATED_SingleThreadedTaskQueueForTesting& task_queue) {
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000023 puts(">> Press ENTER to continue...");
24
Danail Kirov6fcf6ca2018-10-25 10:45:47 -070025 while (!_kbhit() || _getch() != '\r') {
26 // Drive the message loop for the thread running the task_queue
Danil Chapovalov82a3f0a2019-10-21 09:24:27 +020027 SendTask(RTC_FROM_HERE, &task_queue, [&]() {
Danail Kirov6fcf6ca2018-10-25 10:45:47 -070028 MSG msg;
29 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
30 TranslateMessage(&msg);
31 DispatchMessage(&msg);
32 }
33 });
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000034 }
35}
36} // namespace test
37} // namespace webrtc