pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 1 | /* |
| 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 Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 10 | #include <Windows.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 11 | #include <assert.h> |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 12 | #include <conio.h> |
| 13 | #include <stdio.h> |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 14 | |
Danil Chapovalov | 82a3f0a | 2019-10-21 09:24:27 +0200 | [diff] [blame] | 15 | #include "rtc_base/task_queue_for_test.h" |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 16 | #include "test/run_loop.h" |
| 17 | |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | namespace test { |
| 20 | |
Danil Chapovalov | 85a1000 | 2019-10-21 15:00:53 +0200 | [diff] [blame] | 21 | void PressEnterToContinue(TaskQueueBase* task_queue) { |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 22 | puts(">> Press ENTER to continue..."); |
| 23 | |
Danail Kirov | 6fcf6ca | 2018-10-25 10:45:47 -0700 | [diff] [blame] | 24 | while (!_kbhit() || _getch() != '\r') { |
| 25 | // Drive the message loop for the thread running the task_queue |
Danil Chapovalov | 85a1000 | 2019-10-21 15:00:53 +0200 | [diff] [blame] | 26 | SendTask(RTC_FROM_HERE, task_queue, [&]() { |
Danail Kirov | 6fcf6ca | 2018-10-25 10:45:47 -0700 | [diff] [blame] | 27 | MSG msg; |
| 28 | if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { |
| 29 | TranslateMessage(&msg); |
| 30 | DispatchMessage(&msg); |
| 31 | } |
| 32 | }); |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 33 | } |
| 34 | } |
| 35 | } // namespace test |
| 36 | } // namespace webrtc |