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

Side by Side Diff: media/mojo/common/mojo_decoder_buffer_converter_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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/mojo/common/mojo_decoder_buffer_converter.h" 5 #include "media/mojo/common/mojo_decoder_buffer_converter.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 const char kIv[] = "0123456789abcdef"; 104 const char kIv[] = "0123456789abcdef";
105 105
106 std::vector<SubsampleEntry> subsamples; 106 std::vector<SubsampleEntry> subsamples;
107 subsamples.push_back(SubsampleEntry(10, 20)); 107 subsamples.push_back(SubsampleEntry(10, 20));
108 subsamples.push_back(SubsampleEntry(30, 40)); 108 subsamples.push_back(SubsampleEntry(30, 40));
109 subsamples.push_back(SubsampleEntry(50, 60)); 109 subsamples.push_back(SubsampleEntry(50, 60));
110 110
111 scoped_refptr<DecoderBuffer> buffer(DecoderBuffer::CopyFrom( 111 scoped_refptr<DecoderBuffer> buffer(DecoderBuffer::CopyFrom(
112 reinterpret_cast<const uint8_t*>(&kData), kDataSize)); 112 reinterpret_cast<const uint8_t*>(&kData), kDataSize));
113 buffer->set_decrypt_config( 113 buffer->set_decrypt_config(
114 base::WrapUnique(new DecryptConfig(kKeyId, kIv, subsamples))); 114 base::MakeUnique<DecryptConfig>(kKeyId, kIv, subsamples));
115 115
116 scoped_refptr<DecoderBuffer> result = ConvertDecoderBufferAndBack(buffer); 116 scoped_refptr<DecoderBuffer> result = ConvertDecoderBufferAndBack(buffer);
117 CompareDecoderBuffer(buffer, result); 117 CompareDecoderBuffer(buffer, result);
118 118
119 // Test empty IV. This is used for clear buffer in an encrypted stream. 119 // Test empty IV. This is used for clear buffer in an encrypted stream.
120 buffer->set_decrypt_config(base::WrapUnique( 120 buffer->set_decrypt_config(base::MakeUnique<DecryptConfig>(
121 new DecryptConfig(kKeyId, "", std::vector<SubsampleEntry>()))); 121 kKeyId, "", std::vector<SubsampleEntry>()));
122 result = ConvertDecoderBufferAndBack(buffer); 122 result = ConvertDecoderBufferAndBack(buffer);
123 CompareDecoderBuffer(buffer, result); 123 CompareDecoderBuffer(buffer, result);
124 } 124 }
125 125
126 } // namespace media 126 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/common/mojo_decoder_buffer_converter.cc ('k') | media/mojo/services/android_mojo_media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698