BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / remoting / codec / codec_test.h
blob7406a586592807c79b1d9c6758b5174465315ff6
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_CODEC_CODEC_TEST_H_
6 #define REMOTING_CODEC_CODEC_TEST_H_
8 #include <list>
10 #include "base/memory/ref_counted.h"
12 namespace webrtc {
13 class DesktopFrame;
14 class DesktopSize;
17 namespace remoting {
19 class VideoDecoder;
20 class VideoEncoder;
22 // Generate test data and test the encoder for a regular encoding sequence.
23 // This will test encoder test and the sequence of messages sent.
25 // If |strict| is set to true then this routine will make sure the updated
26 // rects match dirty rects.
27 void TestVideoEncoder(VideoEncoder* encoder, bool strict);
29 // Generate test data and test the encoder for a sequence of one "changed"
30 // frame followed by one or more "unchanged" frames, and verify that the
31 // encoder sends up to |max_topoff_frames| of non-empty data for unchanged
32 // frames, after which it returns null frames.
33 void TestVideoEncoderEmptyFrames(VideoEncoder* encoder, int max_topoff_frames);
35 // Generate test data and test the encoder and decoder pair.
37 // If |strict| is set to true, this routine will make sure the updated rects
38 // are correct.
39 void TestVideoEncoderDecoder(VideoEncoder* encoder,
40 VideoDecoder* decoder,
41 bool strict);
43 // Generate a frame containing a gradient, and test the encoder and decoder
44 // pair.
45 void TestVideoEncoderDecoderGradient(VideoEncoder* encoder,
46 VideoDecoder* decoder,
47 const webrtc::DesktopSize& screen_size,
48 double max_error_limit,
49 double mean_error_limit);
51 // Run sufficient encoding iterations to measure the FPS of the specified
52 // encoder. The caller may supply one or more DesktopFrames to encode, which
53 // will be cycled through until timing is complete. If the caller does not
54 // supply any frames then a single full-frame of randomized pixels is used.
55 float MeasureVideoEncoderFpsWithSize(VideoEncoder* encoder,
56 const webrtc::DesktopSize& size);
57 float MeasureVideoEncoderFpsWithFrames(
58 VideoEncoder* encoder,
59 const std::list<webrtc::DesktopFrame*>& frames);
61 } // namespace remoting
63 #endif // REMOTING_CODEC_CODEC_TEST_H_