blob: a38fc58b1284bc781b1c6f5cd642f7f66dc3ae48 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
stefan@webrtc.org8fe03af2012-01-23 14:56:14 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
12#define MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020014#include "system_wrappers/include/event_wrapper.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000015
stefan@webrtc.org2baf5f52013-03-13 08:46:25 +000016class NullEventFactory : public webrtc::EventFactory {
17 public:
18 virtual ~NullEventFactory() {}
19
sakalcc452e12017-02-09 04:53:45 -080020 webrtc::EventWrapper* CreateEvent() override { return new NullEvent; }
Yves Gerey665174f2018-06-19 15:03:05 +020021
solenberg@webrtc.org56b5f772013-04-16 10:31:56 +000022 private:
tommi533aedc2017-03-17 08:11:11 -070023 // Private class to avoid more dependencies on it in tests.
24 class NullEvent : public webrtc::EventWrapper {
25 public:
26 ~NullEvent() override {}
27 bool Set() override { return true; }
28 webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT
29 return webrtc::kEventTimeout;
30 }
31 };
pbos@webrtc.orgd21406d2015-03-19 08:18:53 +000032};
niklase@google.com470e71d2011-07-07 08:21:25 +000033
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020034#endif // MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_