From 04dc66499aad05a38e352446a0e86ffac4c5485a Mon Sep 17 00:00:00 2001 From: Carl Desautels Date: Thu, 14 Apr 2011 20:22:53 -0400 Subject: [PATCH] WIP [#22] --- resources/tests.json | 7 +++++-- sundae.js | 26 +++++++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/resources/tests.json b/resources/tests.json index 94f4ee6..cd78fe1 100644 --- a/resources/tests.json +++ b/resources/tests.json @@ -1,5 +1,6 @@ { - "testSuite": [{ + "blurRadius": "1", + "testSuite": [{ "dependancyURL": "resources/test_1.js", "test": [{ "name": "Load test 1", @@ -20,7 +21,7 @@ "run" : "function (canvas) { var gl = canvas.getContext('experimental-webgl'); gl.clearColor(0, 0, 0, 1); gl.clear(gl.COLOR_BUFFER_BIT); }" } }] - },{ + },{ "dependancyURL": ["resources/test_2a.js", "resources/test_2b.js"], "test": [{ "name": "Load test 3", @@ -50,6 +51,7 @@ } }] },{ + "blurRadius": "2", "test": [{ "name": "Known Pass 1", "firstCanvas": { @@ -68,6 +70,7 @@ } },{ "name": "Known Fail 1", + "blurRadius": "3", "firstCanvas": { "src" : { "url" : "resources/default3.png", "type" : "image"} }, diff --git a/sundae.js b/sundae.js index 25ab7cc..e5b602c 100644 --- a/sundae.js +++ b/sundae.js @@ -109,12 +109,12 @@ var sundae = {}; _pool.setup(_numWorkers); getTests(); }; - function reportResult(r,t){ - r.innerHTML = t.name + ": [" + t.firstCanvas.time + "ms] vs " + "[" + t.secondCanvas.time + "ms]"; + function reportResult(r,t,s){ + r.innerHTML = t.name + ": [" + t.firstCanvas.time + "ms] vs " + "[" + t.secondCanvas.time + "ms]" + s; if(t.note) r.innerHTML += " - " + t.note; } - function setupTest(test){ + function setupTest(test, sig){ var name = test.name || "default"; var d = createDiv(_container, name); var r = createDiv(d, name + "-title"); @@ -133,7 +133,7 @@ var sundae = {}; var whenDone = function(who){ isDone[who] = true; if(isDone["first"] == true && isDone["second"] == true){ - reportResult(r, test); + reportResult(r, test, sig); var pix = {}; pix.a = getPixels(a, isWebgl(a)); pix.b = getPixels(b, isWebgl(b)); @@ -227,15 +227,31 @@ var sundae = {}; getScript(deps, callback); } }; + var sbd, tbd; var setupTests = function(tests){ for(var j = 0; j < tests.length; j++){ + if(tests[j].blurRadius){ + tbd = _sigma; + sundae.setBlurRadius(tests[j].blurRadius); + } + else + sundae.setBlurRadius(tbd); if(_tag == "all" || (_tag != "all" && tests[j].tag && tests[j].tag == _tag)) - setupTest(tests[j]); + setupTest(tests[j], _sigma); } }; var setupTestSuites = function(data){ + if(data.blurRadius) + sundae.setBlurRadius(data.blurRadius); + sbd = tbd = _sigma; if(data.testSuite){ for(var i = 0; i < data.testSuite.length; i++){ + if(data.testSuite[i].blurRadius){ + sbd = _sigma; + sundae.setBlurRadius(data.testSuite[i].blurRadius); + } + else + sundae.setBlurRadius(sbd); if(data.testSuite[i].dependancyURL){ loadDeps(data.testSuite[i].dependancyURL, function(tests){