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

Side by Side Diff: mojo/edk/embedder/simple_platform_shared_buffer_unittest.cc

Issue 1529303004: Convert Pass()→std::move() in mojo/edk/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 "mojo/edk/embedder/simple_platform_shared_buffer.h" 5 #include "mojo/edk/embedder/simple_platform_shared_buffer.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 172 }
173 } 173 }
174 174
175 TEST(SimplePlatformSharedBufferTest, MappingsOutliveBuffer) { 175 TEST(SimplePlatformSharedBufferTest, MappingsOutliveBuffer) {
176 scoped_ptr<PlatformSharedBufferMapping> mapping1; 176 scoped_ptr<PlatformSharedBufferMapping> mapping1;
177 scoped_ptr<PlatformSharedBufferMapping> mapping2; 177 scoped_ptr<PlatformSharedBufferMapping> mapping2;
178 178
179 { 179 {
180 scoped_refptr<SimplePlatformSharedBuffer> buffer( 180 scoped_refptr<SimplePlatformSharedBuffer> buffer(
181 SimplePlatformSharedBuffer::Create(100)); 181 SimplePlatformSharedBuffer::Create(100));
182 mapping1 = buffer->Map(0, 100).Pass(); 182 mapping1 = buffer->Map(0, 100);
183 mapping2 = buffer->Map(50, 50).Pass(); 183 mapping2 = buffer->Map(50, 50);
184 static_cast<char*>(mapping1->GetBase())[50] = 'x'; 184 static_cast<char*>(mapping1->GetBase())[50] = 'x';
185 } 185 }
186 186
187 EXPECT_EQ('x', static_cast<char*>(mapping2->GetBase())[0]); 187 EXPECT_EQ('x', static_cast<char*>(mapping2->GetBase())[0]);
188 188
189 static_cast<char*>(mapping2->GetBase())[1] = 'y'; 189 static_cast<char*>(mapping2->GetBase())[1] = 'y';
190 EXPECT_EQ('y', static_cast<char*>(mapping1->GetBase())[51]); 190 EXPECT_EQ('y', static_cast<char*>(mapping1->GetBase())[51]);
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 } // namespace edk 194 } // namespace edk
195 } // namespace mojo 195 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/simple_platform_shared_buffer_posix.cc ('k') | mojo/edk/embedder/simple_platform_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698