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

Side by Side Diff: remoting/base/encoder_vp8_unittest.cc

Issue 9720019: Use scoped_ptr<> to pass ownership in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/encoder_vp8.cc ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace remoting { 23 namespace remoting {
24 24
25 TEST(EncoderVp8Test, TestEncoder) { 25 TEST(EncoderVp8Test, TestEncoder) {
26 EncoderVp8 encoder; 26 EncoderVp8 encoder;
27 TestEncoder(&encoder, false); 27 TestEncoder(&encoder, false);
28 } 28 }
29 29
30 class EncoderCallback { 30 class EncoderCallback {
31 public: 31 public:
32 void DataAvailable(VideoPacket *packet) { 32 void DataAvailable(scoped_ptr<VideoPacket> packet) {
33 delete packet;
34 } 33 }
35 }; 34 };
36 35
37 // Test that calling Encode with a differently-sized CaptureData does not 36 // Test that calling Encode with a differently-sized CaptureData does not
38 // leak memory. 37 // leak memory.
39 TEST(EncoderVp8Test, TestSizeChangeNoLeak) { 38 TEST(EncoderVp8Test, TestSizeChangeNoLeak) {
40 int height = 1000; 39 int height = 1000;
41 int width = 1000; 40 int width = 1000;
42 const int kBytesPerPixel = 4; 41 const int kBytesPerPixel = 4;
43 42
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 EXPECT_TRUE(EncoderVp8::AlignAndClipRect(r1, 50, 50).isEmpty()); 79 EXPECT_TRUE(EncoderVp8::AlignAndClipRect(r1, 50, 50).isEmpty());
81 80
82 // Clipping to odd-sized screen. An unlikely case, and we might not deal 81 // Clipping to odd-sized screen. An unlikely case, and we might not deal
83 // with it cleanly in the encoder (we possibly lose 1px at right & bottom 82 // with it cleanly in the encoder (we possibly lose 1px at right & bottom
84 // of screen). 83 // of screen).
85 EXPECT_EQ(EncoderVp8::AlignAndClipRect(r1, 199, 299), 84 EXPECT_EQ(EncoderVp8::AlignAndClipRect(r1, 199, 299),
86 SkIRect::MakeXYWH(100, 200, 98, 98)); 85 SkIRect::MakeXYWH(100, 200, 98, 98));
87 } 86 }
88 87
89 } // namespace remoting 88 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/encoder_vp8.cc ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698