blob: 95de16bf243b4e76561f6d9144f1fe6494260294 [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
Danil Chapovalov85a10002019-10-21 15:00:53 +020021void PressEnterToContinue(TaskQueueBase* task_queue) {
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000022 puts(">> Press ENTER to continue...");
23
Danail Kirov6fcf6ca2018-10-25 10:45:47 -070024 while (!_kbhit() || _getch() != '\r') {
25 // Drive the message loop for the thread running the task_queue
Danil Chapovalov85a10002019-10-21 15:00:53 +020026 SendTask(RTC_FROM_HERE, task_queue, [&]() {
Danail Kirov6fcf6ca2018-10-25 10:45:47 -070027 MSG msg;
28 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
29 TranslateMessage(&msg);
30 DispatchMessage(&msg);
31 }
32 });
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000033 }
34}
35} // namespace test
36} // namespace webrtc