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

[WebUI] Make HistoryListFocusTest.All works better with actual setTimeout 0

This is a follow-up fix for
https://chromium-review.googlesource.com/c/chromium/src/+/2600274/3/chrome/test/data/webui/test_util.js#135

- Reverted change to chrome/test/data/webui/test_util.js
- Make history_list_focus_test.js work better with actual setTimeout 0

Bug: 402694
Change-Id: I564a7d45678505ef7fe2af3820f7bfeb1101c256
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600327Reviewed-by: default avatarDan Elphick <delphick@chromium.org>
Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: Wanming Lin <wanming.lin@intel.com>
Cr-Commit-Position: refs/heads/master@{#840934}
parent 682e54ce
...@@ -146,6 +146,7 @@ suite('<history-list>', function() { ...@@ -146,6 +146,7 @@ suite('<history-list>', function() {
assertEquals(4, element.historyData_.length); assertEquals(4, element.historyData_.length);
assertEquals(4, items.length); assertEquals(4, items.length);
items[3].$['menu-button'].click(); items[3].$['menu-button'].click();
await flushTasks();
element.$$('#menuRemoveButton').click(); element.$$('#menuRemoveButton').click();
assertNotEquals(items[2].$['menu-button'], element.lastFocused_); assertNotEquals(items[2].$['menu-button'], element.lastFocused_);
await testService.whenCalled('removeVisits'); await testService.whenCalled('removeVisits');
......
...@@ -132,7 +132,7 @@ cr.define('test_util', function() { ...@@ -132,7 +132,7 @@ cr.define('test_util', function() {
// Promises have microtask timing, so we use setTimeout to explicitly force // Promises have microtask timing, so we use setTimeout to explicitly force
// a new task. // a new task.
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
window.setTimeout(resolve, 1); window.setTimeout(resolve, 0);
}); });
} }
......
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