xref: /aosp_15_r20/external/webrtc/api/video/test/video_frame_matchers.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2022 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  */
10 
11 #ifndef API_VIDEO_TEST_VIDEO_FRAME_MATCHERS_H_
12 #define API_VIDEO_TEST_VIDEO_FRAME_MATCHERS_H_
13 
14 #include "api/rtp_packet_infos.h"
15 #include "api/video/video_frame.h"
16 #include "test/gmock.h"
17 
18 namespace webrtc::test::video_frame_matchers {
19 
20 MATCHER_P(Rotation, rotation, "") {
21   return ::testing::Matches(::testing::Eq(rotation))(arg.rotation());
22 }
23 
24 MATCHER_P(NtpTimestamp, ntp_ts, "") {
25   return arg.ntp_time_ms() == ntp_ts.ms();
26 }
27 
28 MATCHER_P(PacketInfos, m, "") {
29   return ::testing::Matches(m)(arg.packet_infos());
30 }
31 
32 }  // namespace webrtc::test::video_frame_matchers
33 
34 #endif  // API_VIDEO_TEST_VIDEO_FRAME_MATCHERS_H_
35