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

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

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (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/bind_to_current_loop.h" 5 #include "media/base/bind_to_current_loop.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace media { 13 namespace media {
14 14
15 void BoundBoolSet(bool* var, bool val) { 15 void BoundBoolSet(bool* var, bool val) {
16 *var = val; 16 *var = val;
17 } 17 }
18 18
19 void BoundBoolSetFromScopedPtr(bool* var, scoped_ptr<bool> val) { 19 void BoundBoolSetFromScopedPtr(bool* var, scoped_ptr<bool> val) {
20 *var = *val; 20 *var = *val;
21 } 21 }
22 22
23 void BoundBoolSetFromScopedPtrFreeDeleter( 23 void BoundBoolSetFromScopedPtrFreeDeleter(
24 bool* var, 24 bool* var,
25 scoped_ptr<bool, base::FreeDeleter> val) { 25 scoped_ptr<bool, base::FreeDeleter> val) {
26 *var = val; 26 *var = *val;
dcheng 2016/01/19 23:50:55 Note: I changed this to deref the value of the sco
27 } 27 }
28 28
29 void BoundBoolSetFromScopedArray(bool* var, scoped_ptr<bool[]> val) { 29 void BoundBoolSetFromScopedArray(bool* var, scoped_ptr<bool[]> val) {
30 *var = val[0]; 30 *var = val[0];
31 } 31 }
32 32
33 void BoundBoolSetFromConstRef(bool* var, const bool& val) { 33 void BoundBoolSetFromConstRef(bool* var, const bool& val) {
34 *var = val; 34 *var = val;
35 } 35 }
36 36
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 &BoundIntegersSet, &a, &b)); 161 &BoundIntegersSet, &a, &b));
162 cb.Run(1, -1); 162 cb.Run(1, -1);
163 EXPECT_EQ(a, 0); 163 EXPECT_EQ(a, 0);
164 EXPECT_EQ(b, 0); 164 EXPECT_EQ(b, 0);
165 loop_.RunUntilIdle(); 165 loop_.RunUntilIdle();
166 EXPECT_EQ(a, 1); 166 EXPECT_EQ(a, 1);
167 EXPECT_EQ(b, -1); 167 EXPECT_EQ(b, -1);
168 } 168 }
169 169
170 } // namespace media 170 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698