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

Side by Side Diff: mojo/public/c/system/tests/wait_unittest.cc

Issue 2056513002: Plumb MojoReplaceHandleWithReducedRights() out. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_replace_reduce_1
Patch Set: Created 4 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This file tests the C wait API (the functions declared in 5 // This file tests the C wait API (the functions declared in
6 // mojo/public/c/system/wait.h). 6 // mojo/public/c/system/wait.h).
7 7
8 #include "mojo/public/c/system/handle.h" 8 #include "mojo/public/c/system/handle.h"
9 #include "mojo/public/c/system/result.h" 9 #include "mojo/public/c/system/result.h"
10 #include "mojo/public/c/system/wait.h" 10 #include "mojo/public/c/system/wait.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace { 13 namespace {
14 14
15 TEST(WaitTest, InvalidHandle) { 15 TEST(WaitTest, InvalidHandle) {
16 // Wait:
17 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, 16 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
18 MojoWait(MOJO_HANDLE_INVALID, ~MOJO_HANDLE_SIGNAL_NONE, 1000000u, 17 MojoWait(MOJO_HANDLE_INVALID, ~MOJO_HANDLE_SIGNAL_NONE, 1000000u,
19 nullptr)); 18 nullptr));
20 19
21 const MojoHandle h = MOJO_HANDLE_INVALID; 20 const MojoHandle h = MOJO_HANDLE_INVALID;
22 MojoHandleSignals sig = ~MOJO_HANDLE_SIGNAL_NONE; 21 MojoHandleSignals sig = ~MOJO_HANDLE_SIGNAL_NONE;
23 EXPECT_EQ( 22 EXPECT_EQ(
24 MOJO_RESULT_INVALID_ARGUMENT, 23 MOJO_RESULT_INVALID_ARGUMENT,
25 MojoWaitMany(&h, &sig, 1u, MOJO_DEADLINE_INDEFINITE, nullptr, nullptr)); 24 MojoWaitMany(&h, &sig, 1u, MOJO_DEADLINE_INDEFINITE, nullptr, nullptr));
26 } 25 }
27 26
28 // TODO(vtl): Write tests that actually test waiting. 27 // TODO(vtl): Write tests that actually test waiting.
29 28
30 } // namespace 29 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698