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

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

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 8 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/serial_runner.cc ('k') | media/base/simd/convert_rgb_to_yuv_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 #include <memory>
6 7
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
11 #include "media/base/pipeline_status.h" 12 #include "media/base/pipeline_status.h"
12 #include "media/base/serial_runner.h" 13 #include "media/base/serial_runner.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace media { 16 namespace media {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 &SerialRunnerTest::ResetSerialRunner, base::Unretained(this))); 122 &SerialRunnerTest::ResetSerialRunner, base::Unretained(this)));
122 status_cb.Run(PIPELINE_OK); 123 status_cb.Run(PIPELINE_OK);
123 } 124 }
124 125
125 void ResetSerialRunner() { 126 void ResetSerialRunner() {
126 runner_.reset(); 127 runner_.reset();
127 } 128 }
128 129
129 base::MessageLoop message_loop_; 130 base::MessageLoop message_loop_;
130 SerialRunner::Queue bound_fns_; 131 SerialRunner::Queue bound_fns_;
131 scoped_ptr<SerialRunner> runner_; 132 std::unique_ptr<SerialRunner> runner_;
132 133
133 // Used to enforce calling stack guarantees of the API. 134 // Used to enforce calling stack guarantees of the API.
134 bool inside_start_; 135 bool inside_start_;
135 136
136 // Tracks whether the i'th bound function was called. 137 // Tracks whether the i'th bound function was called.
137 std::vector<bool> called_; 138 std::vector<bool> called_;
138 139
139 // Tracks whether the final done callback was called + resulting status. 140 // Tracks whether the final done callback was called + resulting status.
140 bool done_called_; 141 bool done_called_;
141 PipelineStatus done_status_; 142 PipelineStatus done_status_;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 TEST_F(SerialRunnerTest, Closure) { 223 TEST_F(SerialRunnerTest, Closure) {
223 PushClosure(); 224 PushClosure();
224 RunSerialRunner(); 225 RunSerialRunner();
225 226
226 EXPECT_TRUE(called(0)); 227 EXPECT_TRUE(called(0));
227 EXPECT_TRUE(done_called()); 228 EXPECT_TRUE(done_called());
228 EXPECT_EQ(PIPELINE_OK, done_status()); 229 EXPECT_EQ(PIPELINE_OK, done_status());
229 } 230 }
230 231
231 } // namespace media 232 } // namespace media
OLDNEW
« no previous file with comments | « media/base/serial_runner.cc ('k') | media/base/simd/convert_rgb_to_yuv_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698