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

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

Issue 2076263003: Plumb the handle signals state to Awakable::Awake(). (Closed) Base URL: https://github.com/domokit/mojo.git@work794_wait_set_4.2
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
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/wait_set_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/edk/system/core.h" 5 #include "mojo/edk/system/core.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 [&waiter](MojoResult result) { waiter.Awake(result); })); 1946 [&waiter](MojoResult result) { waiter.Awake(result); }));
1947 EXPECT_EQ(0u, info.GetAddedAwakableSize()); 1947 EXPECT_EQ(0u, info.GetAddedAwakableSize());
1948 1948
1949 info.AllowAddAwakable(true); 1949 info.AllowAddAwakable(true);
1950 EXPECT_EQ(MOJO_RESULT_OK, core()->AsyncWait(h, MOJO_HANDLE_SIGNAL_READABLE, 1950 EXPECT_EQ(MOJO_RESULT_OK, core()->AsyncWait(h, MOJO_HANDLE_SIGNAL_READABLE,
1951 [&waiter](MojoResult result) { 1951 [&waiter](MojoResult result) {
1952 waiter.Awake(result); 1952 waiter.Awake(result);
1953 })); 1953 }));
1954 EXPECT_EQ(1u, info.GetAddedAwakableSize()); 1954 EXPECT_EQ(1u, info.GetAddedAwakableSize());
1955 1955
1956 EXPECT_FALSE(info.GetAddedAwakableAt(0)->Awake(MOJO_RESULT_BUSY, 0)); 1956 EXPECT_FALSE(info.GetAddedAwakableAt(0)->Awake(
1957 EXPECT_EQ(MOJO_RESULT_BUSY, waiter.result); 1957 0, Awakable::AwakeReason::UNSATISFIABLE, HandleSignalsState()));
1958 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, waiter.result);
1958 1959
1959 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h)); 1960 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h));
1960 } 1961 }
1961 1962
1962 // TODO(vtl): Test |CreateSharedBuffer()|, |DuplicateBufferHandle()|, and 1963 // TODO(vtl): Test |CreateSharedBuffer()|, |DuplicateBufferHandle()|, and
1963 // |MapBuffer()|. 1964 // |MapBuffer()|.
1964 1965
1965 } // namespace 1966 } // namespace
1966 } // namespace system 1967 } // namespace system
1967 } // namespace mojo 1968 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/wait_set_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698