Add basic canvas tests
[WebKit-https.git] / PerformanceTests / Animometer / runner / resources / tests.js
index 6f77dd71ac568db7c565b054318051fd0b11f4d2..64305d7b3dc76197e10beb680ecabbdc3dba745d 100644 (file)
@@ -38,186 +38,170 @@ var Titles = [
     }
 ];
 
-var Suites = [];
+var Suite = function(name, tests) {
+    this.name = name;
+    this.titles = Titles;
+    this.tests = tests;
+};
+Suite.prototype.prepare = function(runner, contentWindow, contentDocument)
+{
+    return runner.waitForElement("#stage").then(function (element) {
+        return element;
+    });
+};
+Suite.prototype.run = function(contentWindow, test, options, recordTable, progressBar)
+{
+    return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
+};
 
-Suites.push({
-    name: "HTML Bouncing Particles",
-    prepare: function(runner, contentWindow, contentDocument)
-    {
-        return runner.waitForElement("#stage").then(function (element) {
-            return element;
-        });
-    },
-    
-    run: function(contentWindow, test, options, recordTable, progressBar)
-    {
-        return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
-    },
 
-    titles: Titles,
-    tests: [
+var Suites = [];
+
+Suites.push(new Suite("HTML suite",
+    [
         { 
-            url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=12&particleHeight=12&shape=circle",
+            url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=12&particleHeight=12&shape=circle",
             name: "CSS bouncing circles"
         },
         { 
-            url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=40&particleHeight=40&shape=rect&clip=star",
+            url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=40&particleHeight=40&shape=rect&clip=star",
             name: "CSS bouncing clipped rects"
         },
         { 
-            url: "../tests/bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
+            url: "bouncing-particles/bouncing-css-shapes.html?gain=1&addLimit=100&removeLimit=5&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
             name: "CSS bouncing gradient circles"
         },
         {
-            url: "../tests/bouncing-particles/bouncing-css-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
+            url: "bouncing-particles/bouncing-css-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
             name: "CSS bouncing SVG images"
         },
         {
-            url: "../tests/bouncing-particles/bouncing-css-images.html?gain=1&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
+            url: "bouncing-particles/bouncing-css-images.html?gain=1&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
             name: "CSS bouncing PNG images"
         },
         {
-            url: "../tests/text/layering-text.html?gain=4&addLimit=100&removeLimit=100",
+            url: "text/layering-text.html?gain=4&addLimit=100&removeLimit=100",
             name: "CSS layering text"
         },
     ]
-});
+));
 
-Suites.push({
-    name: "Canvas Bouncing Particles",
-    prepare: function(runner, contentWindow, contentDocument)
-    {
-        return runner.waitForElement("#stage").then(function (element) {
-            return element;
-        });
-    },  
-    
-    run: function(contentWindow, test, options, recordTable, progressBar)
-    {
-        return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
-    },
-    
-    titles: Titles,
-    tests: [
+Suites.push(new Suite("Canvas suite",
+    [
         { 
-            url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
+            url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
             name: "canvas bouncing circles"
         },
         { 
-            url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=40&particleHeight=40&shape=rect&clip=star",
+            url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=40&particleHeight=40&shape=rect&clip=star",
             name: "canvas bouncing clipped rects"
         },
         { 
-            url: "../tests/bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
+            url: "bouncing-particles/bouncing-canvas-shapes.html?gain=4&addLimit=100&removeLimit=1000&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
             name: "canvas bouncing gradient circles"
         },
         { 
-            url: "../tests/bouncing-particles/bouncing-canvas-images.html?gain=0.4&addLimit=5&removeLimit=1&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
+            url: "bouncing-particles/bouncing-canvas-images.html?gain=0.4&addLimit=5&removeLimit=1&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
             name: "canvas bouncing SVG images"
         },
         {
-            url: "../tests/bouncing-particles/bouncing-canvas-images.html?gain=4&addLimit=1000&removeLimit=1000&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
+            url: "bouncing-particles/bouncing-canvas-images.html?gain=4&addLimit=1000&removeLimit=1000&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
             name: "canvas bouncing PNG images"
         },
     ]
-});
+));
 
-Suites.push({
-    name: "SVG Bouncing Particles",
-    prepare: function(runner, contentWindow, contentDocument)
-    {
-        return runner.waitForElement("#stage").then(function (element) {
-            return element;
-        });
-    },
-    
-    run: function(contentWindow, test, options, recordTable, progressBar)
-    {
-        return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
-    },
-    
-    titles: Titles,
-    tests: [
+Suites.push(new Suite("SVG suite",
+    [
         {
-            url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=6&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
+            url: "bouncing-particles/bouncing-svg-shapes.html?gain=6&addLimit=100&removeLimit=1000&particleWidth=12&particleHeight=12&shape=circle",
             name: "SVG bouncing circles",
         },
         {
-            url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=0.6&addLimit=10&removeLimit=1&particleWidth=40&particleHeight=40&shape=rect&clip=star",
+            url: "bouncing-particles/bouncing-svg-shapes.html?gain=0.6&addLimit=10&removeLimit=1&particleWidth=40&particleHeight=40&shape=rect&clip=star",
             name: "SVG bouncing clipped rects",
         },
         {
-            url: "../tests/bouncing-particles/bouncing-svg-shapes.html?gain=0.8&addLimit=10&removeLimit=4&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
+            url: "bouncing-particles/bouncing-svg-shapes.html?gain=0.8&addLimit=10&removeLimit=4&particleWidth=50&particleHeight=50&shape=circle&fill=gradient",
             name: "SVG bouncing gradient circles"
         },
         {
-            url: "../tests/bouncing-particles/bouncing-svg-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
+            url: "bouncing-particles/bouncing-svg-images.html?gain=0.4&addLimit=5&removeLimit=2&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
             name: "SVG bouncing SVG images"
         },
         {
-            url: "../tests/bouncing-particles/bouncing-svg-images.html?gain=4&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
+            url: "bouncing-particles/bouncing-svg-images.html?gain=4&addLimit=100&removeLimit=5&particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.png",
             name: "SVG bouncing PNG images"
         },
     ]
-});
+));
 
-Suites.push({
-    name: "More complex examples",
-    prepare: function(runner, contentWindow, contentDocument)
-    {
-        return runner.waitForElement("#stage").then(function (element) {
-            return element;
-        });
-    },
-    
-    run: function(contentWindow, test, options, recordTable, progressBar)
-    {
-        return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
-    },
-    
-    titles: Titles,
-    tests: [
+Suites.push(new Suite("Basic canvas path suite",
+    [
         {
-            url: "../tests/examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
+            url: "simple/simple-canvas-paths.html?pathType=quadratic",
+            name: "Canvas quadratic segments"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?pathType=bezier",
+            name: "Canvas bezier segments"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?&pathType=arcTo",
+            name: "Canvas arcTo segments"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?pathType=arc",
+            name: "Canvas arc segments"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?pathType=rect",
+            name: "Canvas rects"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?&pathType=arcToFill",
+            name: "Canvas arcTo segments, fill"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?pathType=arcFill",
+            name: "Canvas arc segments, fill"
+        },
+        {
+            url: "simple/simple-canvas-paths.html?pathType=rectFill",
+            name: "Canvas rects, fill"
+        }
+    ]
+));
+
+Suites.push(new Suite("Complex examples",
+    [
+        {
+            url: "examples/canvas-electrons.html?gain=1&addLimit=100&removeLimit=10",
             name: "canvas electrons"
         },
         {
-            url: "../tests/examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
+            url: "examples/canvas-stars.html?gain=4&addLimit=100&removeLimit=5",
             name: "canvas stars"
         },
     ]
-});
+));
 
-Suites.push({
-    name: "Stage Templates (Can be used for new tests)",
-    prepare: function(runner, contentWindow, contentDocument)
-    {
-        return runner.waitForElement("#stage").then(function (element) {
-            return element;
-        });
-    },
-    
-    run: function(contentWindow, test, options, recordTable, progressBar)
-    {
-        return contentWindow.runBenchmark(this, test, options, recordTable, progressBar);
-    },
-    
-    titles: Titles,
-    tests: [
+Suites.push(new Suite("Test Templates",
+    [
         {
-            url: "../tests/template/template-css.html?gain=1&addLimit=100&removeLimit=5",
+            url: "template/template-css.html?gain=1&addLimit=100&removeLimit=5",
             name: "CSS template"
         },
         {
-            url: "../tests/template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
+            url: "template/template-canvas.html?gain=1&addLimit=100&removeLimit=1000",
             name: "canvas template"
         },
         {
-            url: "../tests/template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
+            url: "template/template-svg.html?gain=1&addLimit=100&removeLimit=5&<other_paramter>=<value>",
             name: "SVG template"
         },
     ]
-});
+));
 
 function suiteFromName(name)
 {