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

Side by Side Diff: third_party/WebKit/PerformanceTests/Bindings/post-message.html

Issue 2858783003: Refactor prepareToMeasureValuesAsync to startMeasureValuesAsyn which run test through callback (Closed)
Patch Set: update 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 <body> 2 <body>
3 <script src="../resources/runner.js"></script> 3 <script src="../resources/runner.js"></script>
4 <script> 4 <script>
5 var isDone = false; 5 var isDone = false;
6 6
7 function runTest() { 7 function runTest() {
8 var numRound = 1000; 8 var numRound = 1000;
9 var worker = new Worker('resources/worker.js'); 9 var worker = new Worker('resources/worker.js');
10 10
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 function testDone() { 25 function testDone() {
26 isDone = true; 26 isDone = true;
27 } 27 }
28 28
29 window.onload = function () { 29 window.onload = function () {
30 PerfTestRunner.prepareToMeasureValuesAsync({ 30 PerfTestRunner.prepareToMeasureValuesAsync({
31 description: "Measures time to run 1000 postMessage round trips in seria l.", 31 description: "Measures time to run 1000 postMessage round trips in seria l.",
32 unit: 'ms', 32 unit: 'ms',
33 run: function() {
34 runTest();
35 },
Xianzhu 2017/05/03 22:06:25 Nit: a simpler way is run: runTest,
nednguyen 2017/05/04 00:10:32 Done.
33 done: testDone, 36 done: testDone,
34 }); 37 });
35 runTest();
36 }; 38 };
37 </script> 39 </script>
38 <div id="log"></div> 40 <div id="log"></div>
39 </body> 41 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698