add some testcase

This commit is contained in:
侯歌 2024-11-13 18:56:15 +08:00
parent 1deea5ec77
commit 64ed7b9de6
2 changed files with 13 additions and 5 deletions

View File

@ -4442,15 +4442,15 @@ View& View::setFlags(int flags,int mask) {
mPrivateFlags &= ~PFLAG_SKIP_DRAW;
}
requestLayout();
invalidate();
invalidate(true);
}
#if 0
if ((changed & KEEP_SCREEN_ON) != 0) {
if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) {
mParent.recomputeViewAttributes(this);
if (mParent && mAttachInfo && !mAttachInfo->mRecomputeGlobalAttributes) {
mParent->recomputeViewAttributes(this);
}
}
#if 0
if (accessibilityEnabled) {
// If we're an accessibility pane and the visibility changed, we already have sent
// a state change, so we really don't need to report other changes.
@ -4470,7 +4470,6 @@ View& View::setFlags(int flags,int mask) {
}
}
#endif
invalidate(true);
return *this;
}

View File

@ -49,6 +49,15 @@ TEST_F(EVENT,Alloc_Free){
}
}
TEST_F(EVENT,Time){
PointerCoords coords[2];
PointerProperties props[2];
nsecs_t mMoveTime=SystemClock::uptimeMillis();
MotionEvent*e=MotionEvent::obtain(mMoveTime , mMoveTime , 0 , 1,props,coords, 0/*metaState*/,0,
0,0/*x/yPrecision*/,0/*deviceId*/, 0/*edgeFlags*/, 0, 0/*flags*/);
ASSERT_EQ(mMoveTime,e->getEventTime());
}
TEST_F(EVENT,EventPool){
PooledInputEventFactory pool(32);
PointerCoords coords[128];