Commit 9dfc0370 authored by Wanming Lin's avatar Wanming Lin Committed by Chromium LUCI CQ

[DevicePage] Make KeyboardTest works well with actual setTimeout 0

Currently SetTimeout(..., 0) is clamped up to 1ms while which is
not supposed to be in the spec. The Speedometer2 performance can boost
~1% on Windows without it based on Pinpoint perf. This CL is intended
to fix the DevicePage test that become flaky with

https://chromium-review.googlesource.com/c/chromium/src/+/2578703

Flaky test: OSSettingsDevicePageTest.KeyboardTest

Fixing it by invoking additional 'flushTasks()' after
'MockInteractions.pressAndReleaseKeyOn' to make sure
the 'onKeyUp_()' event in
https://source.chromium.org/chromium/chromium/src/+/master:ui/webui/resources/cr_elements/cr_slider/cr_slider.js;l=319
be triggered in time.

Bug: 402694
Change-Id: I2bb9c2a3a52861d2d2f3aaf0eff1a5267bc97671
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2613715Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: Wanming Lin <wanming.lin@intel.com>
Cr-Commit-Position: refs/heads/master@{#841920}
parent f2482078
......@@ -1048,6 +1048,7 @@ cr.define('device_page_tests', function() {
MockInteractions.pressAndReleaseKeyOn(
keyboardPage.$$('#repeatRateSlider').$$('cr-slider'), 39, [],
'ArrowRight');
await test_util.flushTasks();
expectEquals(1000, get('xkb_auto_repeat_delay_r2'));
expectEquals(300, get('xkb_auto_repeat_interval_r2'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment