| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |