| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src = "../resources/runner.js"></script> | 4 <script src = "../resources/runner.js"></script> |
| 5 <script> | 5 <script> |
| 6 var canvas_idle = null; | 6 var canvas_idle = null; |
| 7 var isDone = false; | 7 var isDone = false; |
| 8 | 8 |
| 9 function createCanvas4kBy4k(canvas_id) { | 9 function createCanvas4kBy4k(canvas_id) { |
| 10 var myCanvas = document.createElement("canvas"); | 10 var myCanvas = document.createElement("canvas"); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 requestAnimationFrame(draw); | 32 requestAnimationFrame(draw); |
| 33 } | 33 } |
| 34 | 34 |
| 35 function runTest(myCanvas) { | 35 function runTest(myCanvas) { |
| 36 draw(); //repeatedly draw the frame to keep main thread busy | 36 draw(); //repeatedly draw the frame to keep main thread busy |
| 37 invokeToBlobPng(myCanvas); | 37 invokeToBlobPng(myCanvas); |
| 38 } | 38 } |
| 39 | 39 |
| 40 window.onload = function () { | 40 window.onload = function () { |
| 41 canvas_idle = createCanvas4kBy4k("canvas_idle"); | 41 canvas_idle = createCanvas4kBy4k("canvas_idle"); |
| 42 PerfTestRunner.prepareToMeasureValuesAsync({ | 42 PerfTestRunner.startMeasureValuesAsync({ |
| 43 unit: 'ms', | 43 unit: 'ms', |
| 44 done: function () { | 44 done: function () { |
| 45 isDone = true; | 45 isDone = true; |
| 46 }, | 46 }, |
| 47 description: "Measures performance of canvas." | 47 run: function() { |
| 48 runTest(canvas_idle); |
| 49 }, |
| 50 description: "Measures performance of canvas." |
| 48 }); | 51 }); |
| 49 runTest(canvas_idle); | |
| 50 }; | 52 }; |
| 51 </script> | 53 </script> |
| 52 </body> | 54 </body> |
| 53 </html> | 55 </html> |
| 54 | 56 |
| OLD | NEW |