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

Side by Side Diff: mojo/system/core_unittest.cc

Issue 419973005: Convert WriteMessage...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/core_test_base.cc ('k') | mojo/system/dispatcher.h » ('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/system/core.h" 5 #include "mojo/system/core.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 23 matching lines...) Expand all
34 EXPECT_EQ(0u, info.GetCtorCallCount()); 34 EXPECT_EQ(0u, info.GetCtorCallCount());
35 MojoHandle h = CreateMockHandle(&info); 35 MojoHandle h = CreateMockHandle(&info);
36 EXPECT_EQ(1u, info.GetCtorCallCount()); 36 EXPECT_EQ(1u, info.GetCtorCallCount());
37 EXPECT_NE(h, MOJO_HANDLE_INVALID); 37 EXPECT_NE(h, MOJO_HANDLE_INVALID);
38 38
39 EXPECT_EQ(0u, info.GetWriteMessageCallCount()); 39 EXPECT_EQ(0u, info.GetWriteMessageCallCount());
40 EXPECT_EQ(MOJO_RESULT_OK, 40 EXPECT_EQ(MOJO_RESULT_OK,
41 core()->WriteMessage(h, NullUserPointer(), 0, NullUserPointer(), 0, 41 core()->WriteMessage(h, NullUserPointer(), 0, NullUserPointer(), 0,
42 MOJO_WRITE_MESSAGE_FLAG_NONE)); 42 MOJO_WRITE_MESSAGE_FLAG_NONE));
43 EXPECT_EQ(1u, info.GetWriteMessageCallCount()); 43 EXPECT_EQ(1u, info.GetWriteMessageCallCount());
44 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
45 core()->WriteMessage(h, NullUserPointer(), 1, NullUserPointer(), 0,
46 MOJO_WRITE_MESSAGE_FLAG_NONE));
47 EXPECT_EQ(2u, info.GetWriteMessageCallCount());
48 44
49 EXPECT_EQ(0u, info.GetReadMessageCallCount()); 45 EXPECT_EQ(0u, info.GetReadMessageCallCount());
50 uint32_t num_bytes = 0; 46 uint32_t num_bytes = 0;
51 EXPECT_EQ(MOJO_RESULT_OK, 47 EXPECT_EQ(MOJO_RESULT_OK,
52 core()->ReadMessage(h, NullUserPointer(), 48 core()->ReadMessage(h, NullUserPointer(),
53 MakeUserPointer(&num_bytes), NullUserPointer(), 49 MakeUserPointer(&num_bytes), NullUserPointer(),
54 NullUserPointer(), 50 NullUserPointer(),
55 MOJO_READ_MESSAGE_FLAG_NONE)); 51 MOJO_READ_MESSAGE_FLAG_NONE));
56 EXPECT_EQ(1u, info.GetReadMessageCallCount()); 52 EXPECT_EQ(1u, info.GetReadMessageCallCount());
57 EXPECT_EQ(MOJO_RESULT_OK, 53 EXPECT_EQ(MOJO_RESULT_OK,
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h_passing[1])); 989 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h_passing[1]));
994 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(ph)); 990 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(ph));
995 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(ch)); 991 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(ch));
996 } 992 }
997 993
998 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|. 994 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|.
999 995
1000 } // namespace 996 } // namespace
1001 } // namespace system 997 } // namespace system
1002 } // namespace mojo 998 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/core_test_base.cc ('k') | mojo/system/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698