blob: f8d3adf96da1666ac9d784d1e76a3787bdb5fc4f [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<p id="testElement" spellcheck=false style="height:90vh"></p>
<script>
var isDone = false;
var startTime;
function randomString() {
return '' + Math.floor(1000000 * Math.random());
}
function runTest() {
if (startTime) {
PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
PerfTestRunner.addRunTestEndMarker();
}
if (!isDone) {
PerfTestRunner.addRunTestStartMarker();
startTime = PerfTestRunner.now();
// Fill the paragraph with 1000 lines of text with <br> elements
// in-between.
var testElement = document.getElementById('testElement');
var html = '';
for (var i = 0; i < 1000; i++) {
html += randomString() + ' ' + randomString() + '<br>';
}
testElement.innerHTML = html;
// 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 of many line breaks in one paragraph.',
unit: 'ms',
done: function () {
isDone = true;
},
run: function() {
runTest();
},
iterationCount: 6,
tracingCategories: 'accessibility',
traceEventsToMeasure: [
'RenderAccessibilityImpl::SendPendingAccessibilityEvents',
]
});
</script>
</html>