mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1594 from lightpanda-io/fix_flaky_scroll_test
Fix flaky window.scrollTo test
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
|
||||
restore();
|
||||
testing.expectEqual(2, scrollevt);
|
||||
testing.expectEqual(1, scrollendevt);
|
||||
// This test used to assert that scrollendevt == 1. The idea being that
|
||||
// the above resolve() would stop the test running after "scroll" fires but
|
||||
// before "scrollend" fires. That timing is pretty sensitive/fragile. If
|
||||
// the browser gets delayed and doesn't figure the scroll event exactly when
|
||||
// schedule, it could easily execute in the same sheduler.run call as the
|
||||
// scrollend.
|
||||
testing.expectEqual(true, scrollendevt === 1 || scrollendevt === 2);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user