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

Unified Diff: mojo/edk/system/handle_table_unittest.cc

Issue 1947083003: EDK: Replace HandleTable::GetDispatcher() with GetHandle(). (Closed) Base URL: https://github.com/domokit/mojo.git@work788_edk_handle_13.2
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/handle_table_unittest.cc
diff --git a/mojo/edk/system/handle_table_unittest.cc b/mojo/edk/system/handle_table_unittest.cc
index 33c983d07b21662dbe52cd068faa960d4125d88a..55af970f05dbb4133c710672d4cb6c47893cf1fe 100644
--- a/mojo/edk/system/handle_table_unittest.cc
+++ b/mojo/edk/system/handle_table_unittest.cc
@@ -23,8 +23,8 @@ TEST(HandleTableTest, Basic) {
RefPtr<Dispatcher> d = MakeRefCounted<test::MockSimpleDispatcher>();
- MojoHandle h = ht.AddHandle(Handle(d.Clone(), MOJO_HANDLE_RIGHT_NONE));
- ASSERT_NE(h, MOJO_HANDLE_INVALID);
+ MojoHandle hv = ht.AddHandle(Handle(d.Clone(), MOJO_HANDLE_RIGHT_NONE));
+ ASSERT_NE(hv, MOJO_HANDLE_INVALID);
// Save the pointer value (without taking a ref), so we can check that we get
// the same object back.
@@ -32,18 +32,19 @@ TEST(HandleTableTest, Basic) {
// Reset this, to make sure that the handle table takes a ref.
d = nullptr;
- EXPECT_EQ(MOJO_RESULT_OK, ht.GetDispatcher(h, &d));
- EXPECT_EQ(d.get(), dv);
+ Handle h;
+ EXPECT_EQ(MOJO_RESULT_OK, ht.GetHandle(hv, &h));
+ EXPECT_EQ(dv, h.dispatcher.get());
d = nullptr;
- ASSERT_EQ(MOJO_RESULT_OK, ht.GetAndRemoveDispatcher(h, &d));
- ASSERT_EQ(d.get(), dv);
+ ASSERT_EQ(MOJO_RESULT_OK, ht.GetAndRemoveDispatcher(hv, &d));
+ ASSERT_EQ(dv, d.get());
EXPECT_EQ(MOJO_RESULT_OK, d->Close());
- // We removed |h|, so it should no longer be valid.
- d = nullptr;
- EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, ht.GetDispatcher(h, &d));
+ // We removed |hv|, so it should no longer be valid.
+ h.reset();
+ EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, ht.GetHandle(hv, &h));
}
TEST(HandleTableTest, AddHandlePair) {
« no previous file with comments | « mojo/edk/system/handle_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698