Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/PerformanceTests/Canvas/toBlob_duration_jpeg.html

Issue 2858783003: Refactor prepareToMeasureValuesAsync to startMeasureValuesAsyn which run test through callback (Closed)
Patch Set: Address Xianzhu's review comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 createCanvas4k(canvas_id) { 9 function createCanvas4k(canvas_id) {
10 var myCanvas = document.createElement("canvas"); 10 var myCanvas = document.createElement("canvas");
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 }, "image/jpeg"); 27 }, "image/jpeg");
28 } 28 }
29 29
30 function runTest(myCanvas) { 30 function runTest(myCanvas) {
31 invokeToBlobJpg(myCanvas); 31 invokeToBlobJpg(myCanvas);
32 } 32 }
33 33
34 window.onload = function () { 34 window.onload = function () {
35 canvas_idle = createCanvas4k("canvas_idle"); 35 canvas_idle = createCanvas4k("canvas_idle");
36 PerfTestRunner.prepareToMeasureValuesAsync({ 36 PerfTestRunner.startMeasureValuesAsync({
37 unit: 'ms', 37 unit: 'ms',
38 done: function () { 38 done: function () {
39 isDone = true; 39 isDone = true;
40 }, 40 },
41 run: function() {
42 runTest(canvas_idle);
43 },
41 description: "Measures performance of canvas." 44 description: "Measures performance of canvas."
42 }); 45 });
43 runTest(canvas_idle);
44 }; 46 };
45 </script> 47 </script>
46 </body> 48 </body>
47 </html> 49 </html>
48 50
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698