| 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..3f8bc1f45ae3fcdff181d1755b588842c391492b 100644
|
| --- a/remoting/base/encoder_vp8_unittest.cc
|
| +++ b/remoting/base/encoder_vp8_unittest.cc
|
| @@ -62,4 +62,35 @@ TEST(EncoderVp8Test, TestSizeChangeNoLeak) {
|
| base::Unretained(&callback)));
|
| }
|
|
|
| +class EncoderDpiCallback {
|
| + public:
|
| + void DataAvailable(scoped_ptr<VideoPacket> packet) {
|
| + EXPECT_EQ(packet->format().horizontal_dpi(), 96);
|
| + EXPECT_EQ(packet->format().vertical_dpi(), 97);
|
| + }
|
| +};
|
| +
|
| +// 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(SkIPoint::Make(96, 97));
|
| + encoder.Encode(capture_data, false,
|
| + base::Bind(&EncoderDpiCallback::DataAvailable,
|
| + base::Unretained(&callback)));
|
| +}
|
| +
|
| } // namespace remoting
|
|
|