| 1 | dojo.provide("dojox.html.tests.performance.format"); |
| 2 | |
| 3 | dojo.require("dojox.html.format"); |
| 4 | |
| 5 | |
| 6 | dojox.html.tests.performance.docText = null; |
| 7 | doh.register("format.prettyprint.performance", [ |
| 8 | { |
| 9 | name: "smallDoc", |
| 10 | testType: "perf", |
| 11 | trialDuration: 100, |
| 12 | trialDelay: 50, |
| 13 | trialIterations: 50, |
| 14 | setUp: function() { |
| 15 | var deferred = dojo.xhrGet({ |
| 16 | preventCache: true, |
| 17 | url: dojo.moduleUrl("dojox", "html/tests/performance/smalldoc.txt").toString(), |
| 18 | handleAs: "text", |
| 19 | sync: true |
| 20 | }); |
| 21 | deferred.addCallback(function(txt){ |
| 22 | dojox.html.tests.performance.docText = txt; |
| 23 | }); |
| 24 | deferred.addErrback(function(e){ |
| 25 | console.log(e); |
| 26 | }); |
| 27 | }, |
| 28 | tearDown: function(){ |
| 29 | dojox.html.tests.performance.docText = null; |
| 30 | }, |
| 31 | runTest: function(){ |
| 32 | var s = dojox.html.format.prettyPrint(dojox.html.tests.performance.docText); |
| 33 | } |
| 34 | }, |
| 35 | { |
| 36 | name: "largeDoc", |
| 37 | testType: "perf", |
| 38 | trialDuration: 100, |
| 39 | trialDelay: 50, |
| 40 | trialIterations: 50, |
| 41 | setUp: function() { |
| 42 | var deferred = dojo.xhrGet({ |
| 43 | preventCache: true, |
| 44 | url: dojo.moduleUrl("dojox", "html/tests/performance/largedoc.txt").toString(), |
| 45 | handleAs: "text", |
| 46 | sync: true |
| 47 | }); |
| 48 | deferred.addCallback(function(txt){ |
| 49 | dojox.html.tests.performance.docText = txt; |
| 50 | }); |
| 51 | deferred.addErrback(function(e){ |
| 52 | console.log(e); |
| 53 | }); |
| 54 | }, |
| 55 | tearDown: function(){ |
| 56 | dojox.html.tests.performance.docText = null; |
| 57 | }, |
| 58 | runTest: function(){ |
| 59 | var s = dojox.html.format.prettyPrint(dojox.html.tests.performance.docText); |
| 60 | } |
| 61 | } |
| 62 | ]); |
| 63 |