blob: c6b29f77ed19cbe26a32363c9571be71a965c7e3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<textarea id="testElement" spellcheck=false style="height:90vh"></textarea>
<script>
var isDone = false;
var startTime;
function runTest() {
if (startTime) {
PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
PerfTestRunner.addRunTestEndMarker();
}
if (!isDone) {
PerfTestRunner.addRunTestStartMarker();
startTime = PerfTestRunner.now();
// Fill the textarea with 1000 lines of random numbers.
var testElement = document.getElementById('testElement');
testElement.textContent = new Array(1000).fill(0).map(
(_, i) => Math.floor(100*Math.random())).join('\n');
// Wait to allow the asynchronous accessibility code that's
// covered by traceEventsToMeasure to have a chance to run.
setTimeout(runTest, 1500);
}
}
PerfTestRunner.startMeasureValuesAsync({
description: 'Test accessibility performance when appending to a textarea.',
unit: 'ms',
done: function () {
isDone = true;
},
run: function() {
runTest();
},
iterationCount: 6,
tracingCategories: 'accessibility',
traceEventsToMeasure: [
'RenderAccessibilityImpl::SendPendingAccessibilityEvents',
]
});
</script>
</html>