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

Side by Side Diff: third_party/WebKit/PerformanceTests/Canvas/toBlob_duration.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 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698