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

Side by Side Diff: mojo/edk/system/dispatcher_unittest.cc

Issue 1350183002: EDK: More scoped_ptr -> std::unique_ptr conversions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: gah Created 5 years, 3 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 | « mojo/edk/system/dispatcher.cc ('k') | mojo/edk/system/ipc_support_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 "mojo/edk/system/dispatcher.h" 5 #include "mojo/edk/system/dispatcher.h"
6 6
7 #include <memory>
8
7 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
9 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/simple_thread.h" 12 #include "base/threading/simple_thread.h"
11 #include "mojo/edk/embedder/platform_shared_buffer.h" 13 #include "mojo/edk/embedder/platform_shared_buffer.h"
12 #include "mojo/edk/system/memory.h" 14 #include "mojo/edk/system/memory.h"
13 #include "mojo/edk/system/waiter.h" 15 #include "mojo/edk/system/waiter.h"
14 #include "mojo/public/cpp/system/macros.h" 16 #include "mojo/public/cpp/system/macros.h"
15 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
16 18
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, dispatcher_->EndReadData(0)); 199 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, dispatcher_->EndReadData(0));
198 break; 200 break;
199 case DUPLICATE_BUFFER_HANDLE: { 201 case DUPLICATE_BUFFER_HANDLE: {
200 scoped_refptr<Dispatcher> unused; 202 scoped_refptr<Dispatcher> unused;
201 EXPECT_EQ( 203 EXPECT_EQ(
202 MOJO_RESULT_INVALID_ARGUMENT, 204 MOJO_RESULT_INVALID_ARGUMENT,
203 dispatcher_->DuplicateBufferHandle(NullUserPointer(), &unused)); 205 dispatcher_->DuplicateBufferHandle(NullUserPointer(), &unused));
204 break; 206 break;
205 } 207 }
206 case MAP_BUFFER: { 208 case MAP_BUFFER: {
207 scoped_ptr<embedder::PlatformSharedBufferMapping> unused; 209 std::unique_ptr<embedder::PlatformSharedBufferMapping> unused;
208 EXPECT_EQ( 210 EXPECT_EQ(
209 MOJO_RESULT_INVALID_ARGUMENT, 211 MOJO_RESULT_INVALID_ARGUMENT,
210 dispatcher_->MapBuffer(0u, 0u, MOJO_MAP_BUFFER_FLAG_NONE, &unused)); 212 dispatcher_->MapBuffer(0u, 0u, MOJO_MAP_BUFFER_FLAG_NONE, &unused));
211 break; 213 break;
212 } 214 }
213 case ADD_WAITER: { 215 case ADD_WAITER: {
214 HandleSignalsState hss; 216 HandleSignalsState hss;
215 MojoResult r = dispatcher_->AddAwakable( 217 MojoResult r = dispatcher_->AddAwakable(
216 &waiter_, ~MOJO_HANDLE_SIGNAL_NONE, 0, &hss); 218 &waiter_, ~MOJO_HANDLE_SIGNAL_NONE, 0, &hss);
217 EXPECT_TRUE(r == MOJO_RESULT_FAILED_PRECONDITION || 219 EXPECT_TRUE(r == MOJO_RESULT_FAILED_PRECONDITION ||
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 event.Signal(); 300 event.Signal();
299 } // Joins all the threads. 301 } // Joins all the threads.
300 302
301 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); 303 EXPECT_EQ(MOJO_RESULT_OK, d->Close());
302 } 304 }
303 } 305 }
304 306
305 } // namespace 307 } // namespace
306 } // namespace system 308 } // namespace system
307 } // namespace mojo 309 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/dispatcher.cc ('k') | mojo/edk/system/ipc_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698