blob: 84245336395b0bd8d9508ef3c27b2d53d82b6fb2 [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
mikhal@webrtc.org105ff392011-09-23 16:41:11 +000011#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
12#define WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Henrik Kjellander98f53512015-10-28 18:17:40 +010014#include "webrtc/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; }
solenberg@webrtc.org56b5f772013-04-16 10:31:56 +000021 private:
tommi533aedc2017-03-17 08:11:11 -070022 // Private class to avoid more dependencies on it in tests.
23 class NullEvent : public webrtc::EventWrapper {
24 public:
25 ~NullEvent() override {}
26 bool Set() override { return true; }
27 webrtc::EventTypeWrapper Wait(unsigned long max_time) override { // NOLINT
28 return webrtc::kEventTimeout;
29 }
30 };
pbos@webrtc.orgd21406d2015-03-19 08:18:53 +000031};
niklase@google.com470e71d2011-07-07 08:21:25 +000032
Henrik Kjellander2557b862015-11-18 22:00:21 +010033#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_TEST_UTIL_H_