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

Side by Side Diff: media/base/decoder_buffer_unittest.cc

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_player_unittest.cc ('k') | media/base/fake_demuxer_stream.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) 2012 The Chromium Authors. All rights reserved. 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 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 "media/base/decoder_buffer.h" 5 #include "media/base/decoder_buffer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 const char kKeyId[] = "key id"; 112 const char kKeyId[] = "key id";
113 const char kIv[] = "0123456789abcdef"; 113 const char kIv[] = "0123456789abcdef";
114 std::vector<SubsampleEntry> subsamples; 114 std::vector<SubsampleEntry> subsamples;
115 subsamples.push_back(SubsampleEntry(10, 5)); 115 subsamples.push_back(SubsampleEntry(10, 5));
116 subsamples.push_back(SubsampleEntry(15, 7)); 116 subsamples.push_back(SubsampleEntry(15, 7));
117 117
118 DecryptConfig decrypt_config(kKeyId, kIv, subsamples); 118 DecryptConfig decrypt_config(kKeyId, kIv, subsamples);
119 119
120 buffer->set_decrypt_config( 120 buffer->set_decrypt_config(
121 base::WrapUnique(new DecryptConfig(kKeyId, kIv, subsamples))); 121 base::MakeUnique<DecryptConfig>(kKeyId, kIv, subsamples));
122 122
123 EXPECT_TRUE(buffer->decrypt_config()); 123 EXPECT_TRUE(buffer->decrypt_config());
124 EXPECT_TRUE(buffer->decrypt_config()->Matches(decrypt_config)); 124 EXPECT_TRUE(buffer->decrypt_config()->Matches(decrypt_config));
125 } 125 }
126 126
127 TEST(DecoderBufferTest, IsKeyFrame) { 127 TEST(DecoderBufferTest, IsKeyFrame) {
128 scoped_refptr<DecoderBuffer> buffer(new DecoderBuffer(0)); 128 scoped_refptr<DecoderBuffer> buffer(new DecoderBuffer(0));
129 EXPECT_FALSE(buffer->is_key_frame()); 129 EXPECT_FALSE(buffer->is_key_frame());
130 130
131 buffer->set_is_key_frame(false); 131 buffer->set_is_key_frame(false);
132 EXPECT_FALSE(buffer->is_key_frame()); 132 EXPECT_FALSE(buffer->is_key_frame());
133 133
134 buffer->set_is_key_frame(true); 134 buffer->set_is_key_frame(true);
135 EXPECT_TRUE(buffer->is_key_frame()); 135 EXPECT_TRUE(buffer->is_key_frame());
136 } 136 }
137 137
138 } // namespace media 138 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_player_unittest.cc ('k') | media/base/fake_demuxer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698