Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: remoting/base/encoder_vp8_unittest.cc

Issue 10877014: Moved the video encoders/decoders to the codec directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/encoder_vp8.cc ('k') | remoting/client/rectangle_update_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_vp8_unittest.cc
diff --git a/remoting/base/encoder_vp8_unittest.cc b/remoting/base/encoder_vp8_unittest.cc
deleted file mode 100644
index 635284b60ecd47830e4f2f1194ddc347e2516306..0000000000000000000000000000000000000000
--- a/remoting/base/encoder_vp8_unittest.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <limits>
-#include <vector>
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
-#include "remoting/base/capture_data.h"
-#include "remoting/base/codec_test.h"
-#include "remoting/base/encoder_vp8.h"
-#include "remoting/proto/video.pb.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-const int kIntMax = std::numeric_limits<int>::max();
-
-} // namespace
-
-namespace remoting {
-
-TEST(EncoderVp8Test, TestEncoder) {
- EncoderVp8 encoder;
- TestEncoder(&encoder, false);
-}
-
-class EncoderCallback {
- public:
- void DataAvailable(scoped_ptr<VideoPacket> packet) {
- }
-};
-
-// Test that calling Encode with a differently-sized CaptureData does not
-// leak memory.
-TEST(EncoderVp8Test, TestSizeChangeNoLeak) {
- int height = 1000;
- int width = 1000;
- const int kBytesPerPixel = 4;
-
- EncoderVp8 encoder;
- EncoderCallback 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));
- encoder.Encode(capture_data, false,
- base::Bind(&EncoderCallback::DataAvailable,
- base::Unretained(&callback)));
-
- height /= 2;
- capture_data = new CaptureData(planes, SkISize::Make(width, height),
- media::VideoFrame::RGB32);
- encoder.Encode(capture_data, false,
- base::Bind(&EncoderCallback::DataAvailable,
- base::Unretained(&callback)));
-}
-
-class EncoderDpiCallback {
- public:
- void DataAvailable(scoped_ptr<VideoPacket> packet) {
- EXPECT_EQ(packet->format().x_dpi(), 96);
- EXPECT_EQ(packet->format().y_dpi(), 97);
- }
-};
-
-// Test that the DPI information is correctly propagated from the CaptureData
-// to the VideoPacket.
-TEST(EncoderVp8Test, TestDpiPropagation) {
- int height = 32;
- int width = 32;
- 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
« no previous file with comments | « remoting/base/encoder_vp8.cc ('k') | remoting/client/rectangle_update_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698