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

Side by Side Diff: mojo/public/c/system/tests/core_unittest_pure_c.c

Issue 2750273002: Revert of Mojo EDK: Introduce MojoQueryHandleSignalsState API (Closed)
Patch Set: Created 3 years, 9 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/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.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 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 #ifdef __cplusplus 5 #ifdef __cplusplus
6 #error "This file should be compiled as C, not C++." 6 #error "This file should be compiled as C, not C++."
7 #endif 7 #endif
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 char buffer[200] = {0}; 47 char buffer[200] = {0};
48 uint32_t num_bytes; 48 uint32_t num_bytes;
49 49
50 ticks = MojoGetTimeTicksNow(); 50 ticks = MojoGetTimeTicksNow();
51 EXPECT_NE(ticks, 0); 51 EXPECT_NE(ticks, 0);
52 52
53 handle0 = MOJO_HANDLE_INVALID; 53 handle0 = MOJO_HANDLE_INVALID;
54 EXPECT_NE(MOJO_RESULT_OK, MojoClose(handle0)); 54 EXPECT_NE(MOJO_RESULT_OK, MojoClose(handle0));
55 55
56 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 56 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
57 MojoQueryHandleSignalsState(handle0, NULL));
58
59 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
60 MojoWait(handle0, ~MOJO_HANDLE_SIGNAL_NONE, 57 MojoWait(handle0, ~MOJO_HANDLE_SIGNAL_NONE,
61 MOJO_DEADLINE_INDEFINITE, NULL)); 58 MOJO_DEADLINE_INDEFINITE, NULL));
62 59
63 handle1 = MOJO_HANDLE_INVALID; 60 handle1 = MOJO_HANDLE_INVALID;
64 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1)); 61 EXPECT_EQ(MOJO_RESULT_OK, MojoCreateMessagePipe(NULL, &handle0, &handle1));
65 62
66 signals = MOJO_HANDLE_SIGNAL_READABLE; 63 signals = MOJO_HANDLE_SIGNAL_READABLE;
67 uint32_t result_index = 123; 64 uint32_t result_index = 123;
68 struct MojoHandleSignalsState states[1]; 65 struct MojoHandleSignalsState states[1];
69 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, 66 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED,
(...skipping 27 matching lines...) Expand all
97 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes); 94 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes);
98 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello))); 95 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello)));
99 96
100 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0)); 97 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0));
101 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1)); 98 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1));
102 99
103 // TODO(vtl): data pipe 100 // TODO(vtl): data pipe
104 101
105 return NULL; 102 return NULL;
106 } 103 }
OLDNEW
« no previous file with comments | « mojo/public/c/system/tests/core_unittest.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698