Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / test / performance / window.js
1 /*!
2  * Ext JS Library 3.3.1
3  * Copyright(c) 2006-2010 Sencha Inc.
4  * licensing@sencha.com
5  * http://www.sencha.com/license
6  */
7 /**
8  * Creates a window with 40 tabs, profiles initial rendering speed and resize rendering speed
9  */
10
11 function addWindowPerformanceTest() {
12         Ext.test.profiler.add({
13         name      : 'AnchorLayout',
14         skipVersions: ['2.2.0', '3.1.0'],
15         iterations: 1000,
16         newWindow : true,
17
18         beforeAll : function() {
19             this.previousBuffer = Ext.Container.bufferResize;
20             Ext.Container.bufferResize = false;
21         },
22
23         afterAll : function() {
24             Ext.Container.bufferResize = this.previousBuffer;
25         },
26
27         execute   : function() {
28
29
30             this.win = new Ext.Viewport({
31                 layout: 'fit',
32                 items: [{
33                     xtype: 'container',
34                     layout: 'form',
35                     items: [{
36                         xtype: 'textfield',
37                         width: 100
38                     }, {
39                         xtype: 'textfield',
40                         anchor: '100%'
41                     },
42                     {
43                         xtype: 'textfield',
44                         anchor: '100%'
45                     },
46                     {
47                         xtype: 'textfield',
48                         anchor: '100%'
49                     },
50                     {
51                         xtype: 'textfield',
52                         anchor: '100%'
53                     },
54                     {
55                         xtype: 'textfield',
56                         anchor: '100%'
57                     },
58                     {
59                         xtype: 'textfield',
60                         anchor: '100%'
61                     },
62                     {
63                         xtype: 'textfield',
64                         anchor: '100%'
65                     },
66                     {
67                         xtype: 'textfield',
68                         anchor: '100%'
69                     },
70                     {
71                         xtype: 'textfield',
72                         anchor: '100%'
73                     },
74                     {
75                         xtype: 'textfield',
76                         anchor: '100%'
77                     },
78                     {
79                         xtype: 'textfield',
80                         anchor: '100%'
81                     },
82                     {
83                         xtype: 'textfield',
84                         anchor: '100%'
85                     },
86                     {
87                         xtype: 'textfield',
88                         anchor: '100%'
89                     },
90                     {
91                         xtype: 'textfield',
92                         anchor: '100%'
93                     },
94                     {
95                         xtype: 'textfield',
96                         anchor: '100%'
97                     },
98                     {
99                         xtype: 'textfield',
100                         anchor: '100%'
101                     },
102                     {
103                         xtype: 'textfield',
104                         anchor: '100%'
105                     },
106                     {
107                         xtype: 'textfield',
108                         anchor: '100%'
109                     },
110                     {
111                         xtype: 'textfield',
112                         anchor: '100%'
113                     },
114                     {
115                         xtype: 'textfield',
116                         anchor: '100%'
117                     },
118                     {
119                         xtype: 'textfield',
120                         width: 100
121                     }]
122                 }]
123             });
124
125         },
126
127         afterEach: function() {
128           this.win.destroy();
129         }
130     });
131 /*
132     Ext.test.profiler.add({
133         name      : 'ColumnLayout',
134         skipVersions: ['2.2.0'],
135         iterations: 50,
136         newWindow : true,
137
138         beforeAll : function() {
139             this.previousBuffer = Ext.Container.bufferResize;
140             Ext.Container.bufferResize = false;
141         },
142
143         afterAll : function() {
144             Ext.Container.bufferResize = this.previousBuffer;
145         },
146
147         execute   : function() {
148
149             this.win = new Ext.Viewport({
150                 layout: 'fit',
151                 items: [{
152                     xtype: 'container',
153                     layout: 'column',
154                     defaults: {
155                         height: 30
156                     },
157                     items: [{
158                         xtype: 'container',
159                         width: 100
160                     }, {
161                         xtype: 'container',
162                         columnWidth: .05
163                     },
164                     {
165                         xtype: 'container',
166                         columnWidth: .05
167                     },
168                     {
169                         xtype: 'container',
170                         columnWidth: .05
171                     },
172                     {
173                         xtype: 'container',
174                         columnWidth: .05
175                     },
176                     {
177                         xtype: 'container',
178                         columnWidth: .05
179                     },
180                     {
181                         xtype: 'container',
182                         columnWidth: .05
183                     },
184                     {
185                         xtype: 'container',
186                         columnWidth: .05
187                     },
188                     {
189                         xtype: 'container',
190                         columnWidth: .05
191                     },
192                     {
193                         xtype: 'container',
194                         columnWidth: .05
195                     },
196                     {
197                         xtype: 'container',
198                         columnWidth: .05
199                     },
200                     {
201                         xtype: 'container',
202                         columnWidth: .05
203                     },
204                     {
205                         xtype: 'container',
206                         columnWidth: .05
207                     },
208                     {
209                         xtype: 'container',
210                         columnWidth: .05
211                     },
212                     {
213                         xtype: 'container',
214                         columnWidth: .05
215                     },
216                     {
217                         xtype: 'container',
218                         columnWidth: .05
219                     },
220                     {
221                         xtype: 'container',
222                         columnWidth: .05
223                     },
224                     {
225                         xtype: 'container',
226                         columnWidth: .05
227                     },
228                     {
229                         xtype: 'container',
230                         columnWidth: .05
231                     },
232                     {
233                         xtype: 'container',
234                         columnWidth: .05
235                     },
236                     {
237                         xtype: 'container',
238                         columnWidth: .05
239                     },
240                     {
241                         xtype: 'container',
242                         width: 100
243                     }]
244                 }]
245             });
246
247         },
248
249         afterEach: function() {
250           this.win.destroy();
251         }
252     });
253
254     Ext.test.profiler.add({
255         name      : 'HBoxLayout',
256         skipVersions: ['2.2.0'],
257         iterations: 50,
258         newWindow : true,
259
260         beforeAll : function() {
261             this.previousBuffer = Ext.Container.bufferResize;
262             Ext.Container.bufferResize = false;
263         },
264
265         afterAll : function() {
266             Ext.Container.bufferResize = this.previousBuffer;
267         },
268
269         execute   : function() {
270
271             this.win = new Ext.Viewport({
272                 layout: 'fit',
273                 items: [{
274                     xtype: 'container',
275                     layout: 'hbox',
276                     layoutConfig: {
277                         align: 'stretch'
278                     },
279                     items: [{
280                         xtype: 'container',
281                         width: 100
282                     }, {
283                         xtype: 'container',
284                         flex: 1
285                     },
286                     {
287                         xtype: 'container',
288                         flex: 2
289                     },
290                     {
291                         xtype: 'container',
292                         flex: 3
293                     },
294                     {
295                         xtype: 'container',
296                         flex: 1
297                     },
298                     {
299                         xtype: 'container',
300                         flex: 2
301                     },
302                     {
303                         xtype: 'container',
304                         flex: 3
305                     },
306                     {
307                         xtype: 'container',
308                         flex: 1
309                     },
310                     {
311                         xtype: 'container',
312                         flex: 2
313                     },
314                     {
315                         xtype: 'container',
316                         flex: 3
317                     },
318                     {
319                         xtype: 'container',
320                         flex: 1
321                     },
322                     {
323                         xtype: 'container',
324                         flex: 2
325                     },
326                     {
327                         xtype: 'container',
328                         flex: 3
329                     },
330                     {
331                         xtype: 'container',
332                         flex: 1
333                     },
334                     {
335                         xtype: 'container',
336                         flex: 2
337                     },
338                     {
339                         xtype: 'container',
340                         flex: 3
341                     },
342                     {
343                         xtype: 'container',
344                         flex: 1
345                     },
346                     {
347                         xtype: 'container',
348                         flex: 2
349                     },
350                     {
351                         xtype: 'container',
352                         flex: 3
353                     },
354                     {
355                         xtype: 'container',
356                         flex: 1
357                     },
358                     {
359                         xtype: 'container',
360                         flex: 2
361                     },
362                     {
363                         xtype: 'container',
364                         flex: 3
365                     },
366                     {
367                         xtype: 'container',
368                         flex: 1
369                     },
370                     {
371                         xtype: 'container',
372                         flex: 2
373                     },
374                     {
375                         xtype: 'container',
376                         flex: 3
377                     },
378                     {
379                         xtype: 'container',
380                         flex: 1
381                     },
382                     {
383                         xtype: 'container',
384                         flex: 2
385                     },
386                     {
387                         xtype: 'container',
388                         flex: 3
389                     },
390                     {
391                         xtype: 'container',
392                         flex: 1
393                     },
394                     {
395                         xtype: 'container',
396                         flex: 2
397                     },
398                     {
399                         xtype: 'container',
400                         flex: 3
401                     },
402                     {
403                         xtype: 'container',
404                         flex: 1
405                     },
406                     {
407                         xtype: 'container',
408                         flex: 2
409                     },
410                     {
411                         xtype: 'container',
412                         flex: 3
413                     },
414                     {
415                         xtype: 'container',
416                         flex: 1
417                     },
418                     {
419                         xtype: 'container',
420                         flex: 2
421                     },
422                     {
423                         xtype: 'container',
424                         flex: 3
425                     },
426                     {
427                         xtype: 'container',
428                         flex: 1
429                     },
430                     {
431                         xtype: 'container',
432                         flex: 2
433                     },
434                     {
435                         xtype: 'container',
436                         flex: 3
437                     },
438                     {
439                         xtype: 'container',
440                         flex: 1
441                     },
442                     {
443                         xtype: 'container',
444                         flex: 2
445                     },
446                     {
447                         xtype: 'container',
448                         flex: 3
449                     },
450                     {
451                         xtype: 'container',
452                         flex: 1
453                     },
454                     {
455                         xtype: 'container',
456                         flex: 2
457                     },
458                     {
459                         xtype: 'container',
460                         flex: 3
461                     },
462                     {
463                         xtype: 'container',
464                         flex: 1
465                     },
466                     {
467                         xtype: 'container',
468                         flex: 2
469                     },
470                     {
471                         xtype: 'container',
472                         flex: 3
473                     },
474                     {
475                         xtype: 'container',
476                         width: 100
477                     }]
478                 }]
479             });
480
481       } ,
482
483         afterEach: function() {
484           this.win.destroy();
485         }
486     });
487 */
488 };
489
490 if (typeof Ext != 'undefined' && typeof Ext.test != 'undefined') {
491     addWindowPerformanceTest();
492 } else {
493     Ext.onReady(addWindowPerformanceTest);
494 }