Lines Matching refs:handler
86 virtual int handler(int fd, int events) = 0;
90 return static_cast<CallbackHandler*>(data)->handler(fd, events); in staticHandler()
107 virtual int handler(int fd, int events) { in handler() function in android::StubCallbackHandler
189 StubCallbackHandler handler(true); in TEST_F() local
191 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
201 EXPECT_EQ(0, handler.callbackCount) in TEST_F()
207 StubCallbackHandler handler(true); in TEST_F() local
210 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
220 EXPECT_EQ(1, handler.callbackCount) in TEST_F()
222 EXPECT_EQ(pipe.receiveFd, handler.fd) in TEST_F()
224 EXPECT_EQ(Looper::EVENT_INPUT, handler.events) in TEST_F()
230 StubCallbackHandler handler(true); in TEST_F() local
232 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
242 EXPECT_EQ(0, handler.callbackCount) in TEST_F()
248 StubCallbackHandler handler(true); in TEST_F() local
251 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
263 EXPECT_EQ(1, handler.callbackCount) in TEST_F()
265 EXPECT_EQ(pipe.receiveFd, handler.fd) in TEST_F()
267 EXPECT_EQ(Looper::EVENT_INPUT, handler.events) in TEST_F()
273 StubCallbackHandler handler(true); in TEST_F() local
276 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
289 EXPECT_EQ(1, handler.callbackCount) in TEST_F()
291 EXPECT_EQ(pipe.receiveFd, handler.fd) in TEST_F()
293 EXPECT_EQ(Looper::EVENT_INPUT, handler.events) in TEST_F()
299 StubCallbackHandler handler(true); in TEST_F() local
301 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
315 EXPECT_EQ(0, handler.callbackCount) in TEST_F()
321 StubCallbackHandler handler(false); in TEST_F() local
323 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
338 EXPECT_EQ(1, handler.callbackCount) in TEST_F()
354 EXPECT_EQ(1, handler.callbackCount) in TEST_F()
422 StubCallbackHandler handler(false); in TEST_F() local
423 handler.setCallback(mLooper, pipe.receiveFd, Looper::EVENT_INPUT); in TEST_F()
464 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
465 mLooper->sendMessage(handler, Message(MSG_TEST1)); in TEST_F()
475 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
477 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
512 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
513 mLooper->sendMessageDelayed(ms2ns(100), handler, Message(MSG_TEST1)); in TEST_F()
523 EXPECT_EQ(size_t(0), handler->messages.size()) in TEST_F()
529 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
531 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
548 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
549 mLooper->sendMessageDelayed(ms2ns(-1000), handler, Message(MSG_TEST1)); in TEST_F()
559 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
561 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
566 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
567 mLooper->sendMessageDelayed(0, handler, Message(MSG_TEST1)); in TEST_F()
577 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
579 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
585 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
586 mLooper->sendMessageAtTime(now + ms2ns(100), handler, Message(MSG_TEST1)); in TEST_F()
596 EXPECT_EQ(size_t(0), handler->messages.size()) in TEST_F()
602 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
604 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
622 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
623 mLooper->sendMessageAtTime(now - ms2ns(1000), handler, Message(MSG_TEST1)); in TEST_F()
633 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
635 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
641 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
642 mLooper->sendMessageAtTime(now, handler, Message(MSG_TEST1)); in TEST_F()
652 EXPECT_EQ(size_t(1), handler->messages.size()) in TEST_F()
654 EXPECT_EQ(MSG_TEST1, handler->messages[0].what) in TEST_F()
659 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
660 mLooper->sendMessage(handler, Message(MSG_TEST1)); in TEST_F()
661 mLooper->sendMessage(handler, Message(MSG_TEST2)); in TEST_F()
662 mLooper->sendMessage(handler, Message(MSG_TEST3)); in TEST_F()
663 mLooper->removeMessages(handler); in TEST_F()
673 EXPECT_EQ(size_t(0), handler->messages.size()) in TEST_F()
680 EXPECT_EQ(size_t(0), handler->messages.size()) in TEST_F()
685 sp<StubMessageHandler> handler = new StubMessageHandler(); in TEST_F() local
686 mLooper->sendMessage(handler, Message(MSG_TEST1)); in TEST_F()
687 mLooper->sendMessage(handler, Message(MSG_TEST2)); in TEST_F()
688 mLooper->sendMessage(handler, Message(MSG_TEST3)); in TEST_F()
689 mLooper->sendMessage(handler, Message(MSG_TEST4)); in TEST_F()
690 mLooper->removeMessages(handler, MSG_TEST3); in TEST_F()
691 mLooper->removeMessages(handler, MSG_TEST1); in TEST_F()
701 EXPECT_EQ(size_t(2), handler->messages.size()) in TEST_F()
703 EXPECT_EQ(MSG_TEST2, handler->messages[0].what) in TEST_F()
705 EXPECT_EQ(MSG_TEST4, handler->messages[1].what) in TEST_F()
712 EXPECT_EQ(size_t(2), handler->messages.size()) in TEST_F()