| Index: remoting/base/encoder_vp8_unittest.cc
|
| diff --git a/remoting/base/encoder_vp8_unittest.cc b/remoting/base/encoder_vp8_unittest.cc
|
| index 0060869cbba75e9c5db0108d9565d36138b46398..a465a95d65f50e85951c43a34566e5c84f166a86 100644
|
| --- a/remoting/base/encoder_vp8_unittest.cc
|
| +++ b/remoting/base/encoder_vp8_unittest.cc
|
| @@ -62,4 +62,34 @@ TEST(EncoderVp8Test, TestSizeChangeNoLeak) {
|
| base::Unretained(&callback)));
|
| }
|
|
|
| +class EncoderDpiCallback {
|
| + public:
|
| + void DataAvailable(scoped_ptr<VideoPacket> packet) {
|
| + EXPECT_EQ(packet->dpi(), 96);
|
| + }
|
| +};
|
| +
|
| +// Test that the DPI information is correctly propagated from the CaptureData
|
| +// to the VideoPacket.
|
| +TEST(EncoderVp8Test, TestDpiPropagation) {
|
| + int height = 1;
|
| + int width = 1;
|
| + const int kBytesPerPixel = 4;
|
| +
|
| + EncoderVp8 encoder;
|
| + EncoderDpiCallback callback;
|
| +
|
| + std::vector<uint8> buffer(width * height * kBytesPerPixel);
|
| + DataPlanes planes;
|
| + planes.data[0] = &buffer.front();
|
| + planes.strides[0] = width;
|
| +
|
| + scoped_refptr<CaptureData> capture_data(new CaptureData(
|
| + planes, SkISize::Make(width, height), media::VideoFrame::RGB32));
|
| + capture_data->set_dpi(96);
|
| + encoder.Encode(capture_data, false,
|
| + base::Bind(&EncoderDpiCallback::DataAvailable,
|
| + base::Unretained(&callback)));
|
| +}
|
| +
|
| } // namespace remoting
|
|
|