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

Side by Side Diff: mojo/edk/system/message_in_transit_test_utils.h

Issue 1353683005: EDK: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk/system. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_ 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_
6 #define MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_ 6 #define MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include <memory>
9
9 #include "mojo/edk/system/message_in_transit.h" 10 #include "mojo/edk/system/message_in_transit.h"
10 11
11 namespace mojo { 12 namespace mojo {
12 namespace system { 13 namespace system {
13 namespace test { 14 namespace test {
14 15
15 // Makes a test message. It will be of type 16 // Makes a test message. It will be of type
16 // |MessageInTransit::Type::ENDPOINT_CLIENT| and subtype 17 // |MessageInTransit::Type::ENDPOINT_CLIENT| and subtype
17 // |MessageInTransit::Subtype::ENDPOINT_CLIENT_DATA|, and contain data 18 // |MessageInTransit::Subtype::ENDPOINT_CLIENT_DATA|, and contain data
18 // associated with |id| (so that test messages with different |id|s are 19 // associated with |id| (so that test messages with different |id|s are
19 // distinguishable). 20 // distinguishable).
20 scoped_ptr<MessageInTransit> MakeTestMessage(unsigned id); 21 std::unique_ptr<MessageInTransit> MakeTestMessage(unsigned id);
21 22
22 // Verifies a test message: ASSERTs that |message| is non-null, and EXPECTs that 23 // Verifies a test message: ASSERTs that |message| is non-null, and EXPECTs that
23 // it looks like a message created using |MakeTestMessage(id)| (see above). 24 // it looks like a message created using |MakeTestMessage(id)| (see above).
24 void VerifyTestMessage(const MessageInTransit* message, unsigned id); 25 void VerifyTestMessage(const MessageInTransit* message, unsigned id);
25 26
26 // Checks if |message| looks like a test message created using 27 // Checks if |message| looks like a test message created using
27 // |MakeTestMessage()|, in which case it returns true and sets |*id|. (Otherwise 28 // |MakeTestMessage()|, in which case it returns true and sets |*id|. (Otherwise
28 // it returns false and leaves |*id| alone.) 29 // it returns false and leaves |*id| alone.)
29 bool IsTestMessage(MessageInTransit* message, unsigned* id); 30 bool IsTestMessage(MessageInTransit* message, unsigned* id);
30 31
31 } // namespace test 32 } // namespace test
32 } // namespace system 33 } // namespace system
33 } // namespace mojo 34 } // namespace mojo
34 35
35 #endif // MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_ 36 #endif // MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/message_in_transit_queue.h ('k') | mojo/edk/system/message_in_transit_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698