Page MenuHomePhabricator

tests/elm: add basic timestamping for event helpers
ClosedPublic

Authored by zmike on Jan 6 2020, 11:29 AM.

Details

Summary

this enables various internal components which use timestamps to have timestamps
that can be used

Depends on D11027

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zmike created this revision.Jan 6 2020, 11:29 AM
zmike requested review of this revision.Jan 6 2020, 11:29 AM
zmike updated this revision to Diff 28128.Jan 13 2020, 12:12 PM
zmike edited the summary of this revision. (Show Details)

rebase

How about using global variable static unsigned int ts ?

static unsigned int ts = 0; //global variable in suite_helpers.c

Because the timestamp of each function begins with 0 so timestamp 0 is used in the functions at the same time.
e.g.

//In test code
drag_object(...); //timestamp 0 is used with evas_event_feed_mouse_move
wheel_object_at(...); //timestamp 0 is used with evas_event_feed_mouse_move

BTW, can we use the real timestamp value here?
It seems that the unit of input event timestamp is 1ms.

unsigned int cur_timestamp = (unsigned int)(ecore_time_get() * 1000);
evas_event_feed_mouse_move(e, x, y, cur_timestamp, NULL);
usleep(1000);
cur_timestamp = (unsigned int)(ecore_time_get() * 1000);
evas_event_feed_mouse_down(e, 1, 0, cur_timestamp, NULL);

I am not sure if the above code may cause a problem. (usleep() increases ecore_time_get() but usleep() does not increase ecore_loop_time_get())

zmike added a comment.EditedJan 17 2020, 6:29 AM

Hm these are good points. We can use unsigned int here and start with a value of 1.

I considered using the real time, however, and I decided to just use local monotonic variables for two reasons:

  • continually calling ecore_time_get() is going to slow down input tests
  • there is no checking for timestamp ordering outside of specific input sequences (e.g., a complete gesture recognizer codepath will only verify the events in the sequence of the gesture and not for successive gestures)

I suppose I could change it to use a monotonic global uint which resets on test shutdown, which should have the same effect.

We never specifically check for the use of ms anywhere, so I'm not sure it would be especially useful? The purpose of having timestamps is just to detect event ordering and set thresholds for changing behaviors, and 1ms is already too fast to be a "real" event in this case, so it seems to me there isn't much point in converting to that.

zmike updated this revision to Diff 28254.Jan 17 2020, 7:41 AM
zmike added a reviewer: CHAN.

update

Jaehyun_Cho accepted this revision.Jan 19 2020, 7:51 PM

thank you for the update!

This revision is now accepted and ready to land.Jan 19 2020, 7:51 PM
zmike updated this revision to Diff 28331.Jan 21 2020, 11:55 AM

rebase/update

zmike updated this revision to Diff 28377.Jan 22 2020, 6:35 AM

remove off-canvas blocking

zmike updated this revision to Diff 28428.Jan 23 2020, 12:23 PM

rework/rebase

zmike updated this revision to Diff 28649.Jan 29 2020, 11:19 AM

rebase/rework

bu5hm4n accepted this revision.Jan 30 2020, 7:21 AM
Closed by commit rEFL8cde7424c236: tests/elm: add basic timestamping for event helpers (authored by zmike, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhyJan 30 2020, 8:11 AM
This revision was automatically updated to reflect the committed changes.