summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/dromaeo/tests/dromaeo-object-array.html
blob: d45fb36b71d0c14b95c2e7b309fbf6fedcf6a4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html>
<head>
<script src="../htmlrunner.js"></script>
<script>
window.onload = function(){ startTest("dromaeo-object-array", 'bde4f5f4');

var ret = [], tmp, num = 500;
var i = 1024;

	// TESTS: Array Building

	test("Array Construction, []", function(){
		for ( var j = 0; j < i * 15; j++ ) {
			ret = [];
			ret.length = i;
		}
	});

	test("Array Construction, new Array()", function(){
		for ( var j = 0; j < i * 10; j++ )
			ret = new Array(i);
	});

	test("Array Construction, unshift", function(){
		ret = [];
		for ( var j = 0; j < i; j++ )
			ret.unshift(j);
	});

	test("Array Construction, splice", function(){
		ret = [];
		for ( var j = 0; j < i; j++ )
			ret.splice(0,0,j);
	});

	test("Array Deconstruction, shift", function(){
		var a = ret.slice();
		for ( var j = 0; j < i; j++ )
			tmp = a.shift();
	});

	test("Array Deconstruction, splice", function(){
		var a = ret.slice();
		for ( var j = 0; j < i; j++ )
			tmp = a.splice(0,1);
	});

	test("Array Construction, push", function(){
		ret = [];
		for ( var j = 0; j < i * 25; j++ )
			ret.push(j);
	});

	test("Array Deconstruction, pop", function(){
		var a = ret.slice();
		for ( var j = 0; j < i * 25; j++ )
			tmp = a.pop();
	});

endTest(); };
</script>
</head>
<body></body>
</html>