X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FPerformanceTests%2FLayout%2Fresources%2Ffloats.js;h=58e456c4b92c80399f16dbabb0f291e656ea68ca;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=459c2f456e9c62462c4239e1dd9932f8b30702f5;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/PerformanceTests/Layout/resources/floats.js b/src/third_party/WebKit/PerformanceTests/Layout/resources/floats.js index 459c2f4..58e456c 100644 --- a/src/third_party/WebKit/PerformanceTests/Layout/resources/floats.js +++ b/src/third_party/WebKit/PerformanceTests/Layout/resources/floats.js @@ -34,22 +34,27 @@ list[i].className = "float"; } - function createTestFunction(width, height, nested, runs) { - var container = createSet(width, height, nested); + function createTestFunction(width, height, nested, runs, rows) { + var containers = []; + for (var i = 0; i < rows; ++i) + containers[i] = createSet(width, height, nested); nested = nested || 0; runs = runs || 10; return function() { - container.style.display = "block"; - for (var i = 0; i < runs; ++i) { - var x = Math.floor(Math.random() * width); - var y = Math.floor(Math.random() * height); - var el = document.getElementById("float" + x + "_" + y); - el.className = toggle(el.className, "float", "float big"); - // Force a layout. - container.clientHeight; + for (var c = 0; c < rows; ++c) { + container = containers[c]; + container.style.display = "block"; + for (var i = 0; i < runs; ++i) { + var x = Math.floor(Math.random() * width); + var y = Math.floor(Math.random() * height); + var el = document.getElementById("float" + x + "_" + y); + el.className = toggle(el.className, "float", "float big"); + // Force a layout. + container.clientHeight; + } + resetTest(); + container.style.display = "none"; } - resetTest(); - container.style.display = "none"; } }