Revision control

1
<!DOCTYPE html>
2
<html>
3
<body>
4
<script src="../resources/magnitude-perf.js"></script>
5
<script>
6
var parentForm = null;
7
8
function setup(magnitude) {
9
if (parentForm)
10
document.body.removeChild(parentForm);
11
parentForm = document.createElement('form');
12
document.body.appendChild(parentForm);
13
for (var i = 0; i < magnitude; ++i) {
14
var radio = document.createElement('input');
15
radio.type = 'radio';
16
radio.name = 'group1';
17
radio.checked = true;
18
parentForm.appendChild(radio);
19
}
20
parentForm.offsetLeft;
21
}
22
23
function test(magnitude) {
24
var radio = document.createElement('input');
25
radio.type = 'radio';
26
radio.name = 'group1';
27
radio.checked = true;
28
parentForm.appendChild(radio);
29
radio.offsetLeft;
30
parentForm.removeChild(radio);
31
}
32
33
Magnitude.description("Tests that adding a radio button to a radio button group is linear in the number of radio buttons.");
34
Magnitude.run(setup, test, Magnitude.LINEAR);
35
</script>
36
</body>
37
</html>