This class doesn't strictly follow rtc::TaskQueue semantics, which makes it surprising and hard to use correctly. Please use TaskQueueForTest instead. This CL follows usual deprecation process: 1/ Rename. % for i in `git ls-files` ; sed -i "s:SingleThreadedTaskQueueForTesting:DEPRECATED_SingleThreadedTaskQueueForTesting:" $i 2/ Annotate old name for downstream users and accidental new uses. Bug: webrtc:10933 Change-Id: I80b4ee5a48df1f63f63a43ed0efdb50eb7fb156a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150788 Reviewed-by: Elad Alon <eladalon@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Yves Gerey <yvesg@google.com> Cr-Commit-Position: refs/heads/master@{#29045}
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
/*
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#include <Windows.h>
|
|
#include <assert.h>
|
|
#include <conio.h>
|
|
#include <stdio.h>
|
|
|
|
#include "test/run_loop.h"
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
|
|
void PressEnterToContinue(
|
|
DEPRECATED_SingleThreadedTaskQueueForTesting& task_queue) {
|
|
puts(">> Press ENTER to continue...");
|
|
|
|
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
|
|
} // namespace webrtc
|