Changeset 248996 in webkit
- Timestamp:
- Aug 21, 2019, 10:51:53 PM (7 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
perf/clone-with-focus.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248993 r248996 1 2019-08-21 Ryosuke Niwa <rniwa@webkit.org> 2 3 Layout Test perf/clone-with-focus.html is a Flaky Failure 4 https://bugs.webkit.org/show_bug.cgi?id=201012 5 6 Reviewed by Antti Koivisto. 7 8 The flakiness was observed when the time to clone elements without focus is 0ms 9 but the time to clone elements with focus is 1ms or greater. 10 11 The test tries to make sure the time to clone elements with foucs is less than 2x 12 of the time to clone elements without focus. When the time to clone without focus 13 is 0ms, any difference is always more than 2x larger. 14 15 Fixed the test by increasing the number of elements until the time to clone without 16 focus takes at least 5ms. 17 18 * perf/clone-with-focus.html: 19 1 20 2019-08-21 Myles C. Maxfield <mmaxfield@apple.com> 2 21 -
trunk/LayoutTests/perf/clone-with-focus.html
r120417 r248996 18 18 if (focusInput) 19 19 inputElement.focus(); 20 21 var startTime = Date.now();20 21 var startTime = performance.now(); 22 22 for (var i = 0; i < numberOfElements; i++) { 23 23 var clone = templateElement.cloneNode(true); … … 25 25 listElement.appendChild(clone); 26 26 } 27 var endTime = Date.now();28 27 var endTime = performance.now(); 28 29 29 if (focusInput) 30 30 inputElement.blur(); 31 32 while (listElement.firstChild != listElement.lastChild) 33 listElement.removeChild(listElement.lastChild); 34 31 32 const originalItem = listElement.firstChild; 33 listElement.textContent = ''; 34 listElement.appendChild(originalItem); 35 35 36 return endTime - startTime; 36 37 } … … 43 44 } 44 45 45 var timeWithoutFocus = test(1000, false); 46 var timeWithFocus = test(1000, true); 46 const start = performance.now(); 47 let factor = 0; 48 while (test(1000 * factor, false) < 5) 49 factor++; 50 51 var timeWithoutFocus = test(1000 * factor, false); 52 var timeWithFocus = test(1000 * factor, true); 47 53 48 54 if (Math.abs(timeWithFocus - timeWithoutFocus) <= timeWithoutFocus) {
Note:
See TracChangeset
for help on using the changeset viewer.