| 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 base::Unretained(&waiter)))); | 1297 base::Unretained(&waiter)))); |
| 1298 EXPECT_EQ(0u, info.GetAddedAwakableSize()); | 1298 EXPECT_EQ(0u, info.GetAddedAwakableSize()); |
| 1299 | 1299 |
| 1300 info.AllowAddAwakable(true); | 1300 info.AllowAddAwakable(true); |
| 1301 EXPECT_EQ(MOJO_RESULT_OK, | 1301 EXPECT_EQ(MOJO_RESULT_OK, |
| 1302 core()->AsyncWait(h, MOJO_HANDLE_SIGNAL_READABLE, | 1302 core()->AsyncWait(h, MOJO_HANDLE_SIGNAL_READABLE, |
| 1303 base::Bind(&TestAsyncWaiter::Awake, | 1303 base::Bind(&TestAsyncWaiter::Awake, |
| 1304 base::Unretained(&waiter)))); | 1304 base::Unretained(&waiter)))); |
| 1305 EXPECT_EQ(1u, info.GetAddedAwakableSize()); | 1305 EXPECT_EQ(1u, info.GetAddedAwakableSize()); |
| 1306 | 1306 |
| 1307 EXPECT_EQ(false, info.GetAddedAwakableAt(0)->Awake(MOJO_RESULT_BUSY, 0)); | 1307 EXPECT_FALSE(info.GetAddedAwakableAt(0)->Awake(MOJO_RESULT_BUSY, 0)); |
| 1308 EXPECT_EQ(MOJO_RESULT_BUSY, waiter.result); | 1308 EXPECT_EQ(MOJO_RESULT_BUSY, waiter.result); |
| 1309 | 1309 |
| 1310 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h)); | 1310 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h)); |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|. | 1313 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|. |
| 1314 | 1314 |
| 1315 } // namespace | 1315 } // namespace |
| 1316 } // namespace system | 1316 } // namespace system |
| 1317 } // namespace mojo | 1317 } // namespace mojo |
| OLD | NEW |