Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 5_ajax_objects / _zero_config_objects_subarrays.js
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "Sanity checks for DataTables with data from JS - Object / sub-array data source" );
3
4 oTest.fnTest( 
5         "jQuery.dataTable function",
6         null,
7         function () { return typeof jQuery().dataTable == "function"; }
8 );
9
10 oTest.fnTest(
11         "jQuery.dataTableSettings storage array",
12         null,
13         function () { return typeof jQuery().dataTableSettings == "object"; }
14 );
15
16 oTest.fnTest(
17         "jQuery.dataTableExt plugin object",
18         null,
19         function () { return typeof jQuery().dataTableExt == "object"; }
20 );
21
22 $(document).ready( function () {
23         var oInit = {
24                 "aoColumns": [
25                         { "mData": "engine" },
26                         { "mData": "browser" },
27                         { "mData": "platform" },
28                         { "mData": "details.0" },
29                         { "mData": "details.1" }
30                 ],
31                 "aaData": [
32         {
33                 "engine": "Trident",
34                 "browser": "Internet Explorer 4.0",
35                 "platform": "Win 95+",
36                 "details": [
37                         "4",
38                         "X"
39                 ]
40         },
41         {
42                 "engine": "Trident",
43                 "browser": "Internet Explorer 5.0",
44                 "platform": "Win 95+",
45                 "details": [
46                         "5",
47                         "C"
48                 ]
49         },
50         {
51                 "engine": "Trident",
52                 "browser": "Internet Explorer 5.5",
53                 "platform": "Win 95+",
54                 "details": [
55                         "5.5",
56                         "A"
57                 ]
58         },
59         {
60                 "engine": "Trident",
61                 "browser": "Internet Explorer 6",
62                 "platform": "Win 98+",
63                 "details": [
64                         "6",
65                         "A"
66                 ]
67         },
68         {
69                 "engine": "Trident",
70                 "browser": "Internet Explorer 7",
71                 "platform": "Win XP SP2+",
72                 "details": [
73                         "7",
74                         "A"
75                 ]
76         },
77         {
78                 "engine": "Trident",
79                 "browser": "AOL browser (AOL desktop)",
80                 "platform": "Win XP",
81                 "details": [
82                         "6",
83                         "A"
84                 ]
85         },
86         {
87                 "engine": "Gecko",
88                 "browser": "Firefox 1.0",
89                 "platform": "Win 98+ / OSX.2+",
90                 "details": [
91                         "1.7",
92                         "A"
93                 ]
94         },
95         {
96                 "engine": "Gecko",
97                 "browser": "Firefox 1.5",
98                 "platform": "Win 98+ / OSX.2+",
99                 "details": [
100                         "1.8",
101                         "A"
102                 ]
103         },
104         {
105                 "engine": "Gecko",
106                 "browser": "Firefox 2.0",
107                 "platform": "Win 98+ / OSX.2+",
108                 "details": [
109                         "1.8",
110                         "A"
111                 ]
112         },
113         {
114                 "engine": "Gecko",
115                 "browser": "Firefox 3.0",
116                 "platform": "Win 2k+ / OSX.3+",
117                 "details": [
118                         "1.9",
119                         "A"
120                 ]
121         },
122         {
123                 "engine": "Gecko",
124                 "browser": "Camino 1.0",
125                 "platform": "OSX.2+",
126                 "details": [
127                         "1.8",
128                         "A"
129                 ]
130         },
131         {
132                 "engine": "Gecko",
133                 "browser": "Camino 1.5",
134                 "platform": "OSX.3+",
135                 "details": [
136                         "1.8",
137                         "A"
138                 ]
139         },
140         {
141                 "engine": "Gecko",
142                 "browser": "Netscape 7.2",
143                 "platform": "Win 95+ / Mac OS 8.6-9.2",
144                 "details": [
145                         "1.7",
146                         "A"
147                 ]
148         },
149         {
150                 "engine": "Gecko",
151                 "browser": "Netscape Browser 8",
152                 "platform": "Win 98SE+",
153                 "details": [
154                         "1.7",
155                         "A"
156                 ]
157         },
158         {
159                 "engine": "Gecko",
160                 "browser": "Netscape Navigator 9",
161                 "platform": "Win 98+ / OSX.2+",
162                 "details": [
163                         "1.8",
164                         "A"
165                 ]
166         },
167         {
168                 "engine": "Gecko",
169                 "browser": "Mozilla 1.0",
170                 "platform": "Win 95+ / OSX.1+",
171                 "details": [
172                         1,
173                         "A"
174                 ]
175         },
176         {
177                 "engine": "Gecko",
178                 "browser": "Mozilla 1.1",
179                 "platform": "Win 95+ / OSX.1+",
180                 "details": [
181                         1.1,
182                         "A"
183                 ]
184         },
185         {
186                 "engine": "Gecko",
187                 "browser": "Mozilla 1.2",
188                 "platform": "Win 95+ / OSX.1+",
189                 "details": [
190                         1.2,
191                         "A"
192                 ]
193         },
194         {
195                 "engine": "Gecko",
196                 "browser": "Mozilla 1.3",
197                 "platform": "Win 95+ / OSX.1+",
198                 "details": [
199                         1.3,
200                         "A"
201                 ]
202         },
203         {
204                 "engine": "Gecko",
205                 "browser": "Mozilla 1.4",
206                 "platform": "Win 95+ / OSX.1+",
207                 "details": [
208                         1.4,
209                         "A"
210                 ]
211         },
212         {
213                 "engine": "Gecko",
214                 "browser": "Mozilla 1.5",
215                 "platform": "Win 95+ / OSX.1+",
216                 "details": [
217                         1.5,
218                         "A"
219                 ]
220         },
221         {
222                 "engine": "Gecko",
223                 "browser": "Mozilla 1.6",
224                 "platform": "Win 95+ / OSX.1+",
225                 "details": [
226                         1.6,
227                         "A"
228                 ]
229         },
230         {
231                 "engine": "Gecko",
232                 "browser": "Mozilla 1.7",
233                 "platform": "Win 98+ / OSX.1+",
234                 "details": [
235                         1.7,
236                         "A"
237                 ]
238         },
239         {
240                 "engine": "Gecko",
241                 "browser": "Mozilla 1.8",
242                 "platform": "Win 98+ / OSX.1+",
243                 "details": [
244                         1.8,
245                         "A"
246                 ]
247         },
248         {
249                 "engine": "Gecko",
250                 "browser": "Seamonkey 1.1",
251                 "platform": "Win 98+ / OSX.2+",
252                 "details": [
253                         "1.8",
254                         "A"
255                 ]
256         },
257         {
258                 "engine": "Gecko",
259                 "browser": "Epiphany 2.20",
260                 "platform": "Gnome",
261                 "details": [
262                         "1.8",
263                         "A"
264                 ]
265         },
266         {
267                 "engine": "Webkit",
268                 "browser": "Safari 1.2",
269                 "platform": "OSX.3",
270                 "details": [
271                         "125.5",
272                         "A"
273                 ]
274         },
275         {
276                 "engine": "Webkit",
277                 "browser": "Safari 1.3",
278                 "platform": "OSX.3",
279                 "details": [
280                         "312.8",
281                         "A"
282                 ]
283         },
284         {
285                 "engine": "Webkit",
286                 "browser": "Safari 2.0",
287                 "platform": "OSX.4+",
288                 "details": [
289                         "419.3",
290                         "A"
291                 ]
292         },
293         {
294                 "engine": "Webkit",
295                 "browser": "Safari 3.0",
296                 "platform": "OSX.4+",
297                 "details": [
298                         "522.1",
299                         "A"
300                 ]
301         },
302         {
303                 "engine": "Webkit",
304                 "browser": "OmniWeb 5.5",
305                 "platform": "OSX.4+",
306                 "details": [
307                         "420",
308                         "A"
309                 ]
310         },
311         {
312                 "engine": "Webkit",
313                 "browser": "iPod Touch / iPhone",
314                 "platform": "iPod",
315                 "details": [
316                         "420.1",
317                         "A"
318                 ]
319         },
320         {
321                 "engine": "Webkit",
322                 "browser": "S60",
323                 "platform": "S60",
324                 "details": [
325                         "413",
326                         "A"
327                 ]
328         },
329         {
330                 "engine": "Presto",
331                 "browser": "Opera 7.0",
332                 "platform": "Win 95+ / OSX.1+",
333                 "details": [
334                         "-",
335                         "A"
336                 ]
337         },
338         {
339                 "engine": "Presto",
340                 "browser": "Opera 7.5",
341                 "platform": "Win 95+ / OSX.2+",
342                 "details": [
343                         "-",
344                         "A"
345                 ]
346         },
347         {
348                 "engine": "Presto",
349                 "browser": "Opera 8.0",
350                 "platform": "Win 95+ / OSX.2+",
351                 "details": [
352                         "-",
353                         "A"
354                 ]
355         },
356         {
357                 "engine": "Presto",
358                 "browser": "Opera 8.5",
359                 "platform": "Win 95+ / OSX.2+",
360                 "details": [
361                         "-",
362                         "A"
363                 ]
364         },
365         {
366                 "engine": "Presto",
367                 "browser": "Opera 9.0",
368                 "platform": "Win 95+ / OSX.3+",
369                 "details": [
370                         "-",
371                         "A"
372                 ]
373         },
374         {
375                 "engine": "Presto",
376                 "browser": "Opera 9.2",
377                 "platform": "Win 88+ / OSX.3+",
378                 "details": [
379                         "-",
380                         "A"
381                 ]
382         },
383         {
384                 "engine": "Presto",
385                 "browser": "Opera 9.5",
386                 "platform": "Win 88+ / OSX.3+",
387                 "details": [
388                         "-",
389                         "A"
390                 ]
391         },
392         {
393                 "engine": "Presto",
394                 "browser": "Opera for Wii",
395                 "platform": "Wii",
396                 "details": [
397                         "-",
398                         "A"
399                 ]
400         },
401         {
402                 "engine": "Presto",
403                 "browser": "Nokia N800",
404                 "platform": "N800",
405                 "details": [
406                         "-",
407                         "A"
408                 ]
409         },
410         {
411                 "engine": "Presto",
412                 "browser": "Nintendo DS browser",
413                 "platform": "Nintendo DS",
414                 "details": [
415                         "8.5",
416                         "C/A<sup>1</sup>"
417                 ]
418         },
419         {
420                 "engine": "KHTML",
421                 "browser": "Konqureror 3.1",
422                 "platform": "KDE 3.1",
423                 "details": [
424                         "3.1",
425                         "C"
426                 ]
427         },
428         {
429                 "engine": "KHTML",
430                 "browser": "Konqureror 3.3",
431                 "platform": "KDE 3.3",
432                 "details": [
433                         "3.3",
434                         "A"
435                 ]
436         },
437         {
438                 "engine": "KHTML",
439                 "browser": "Konqureror 3.5",
440                 "platform": "KDE 3.5",
441                 "details": [
442                         "3.5",
443                         "A"
444                 ]
445         },
446         {
447                 "engine": "Tasman",
448                 "browser": "Internet Explorer 4.5",
449                 "platform": "Mac OS 8-9",
450                 "details": [
451                         "-",
452                         "X"
453                 ]
454         },
455         {
456                 "engine": "Tasman",
457                 "browser": "Internet Explorer 5.1",
458                 "platform": "Mac OS 7.6-9",
459                 "details": [
460                         "1",
461                         "C"
462                 ]
463         },
464         {
465                 "engine": "Tasman",
466                 "browser": "Internet Explorer 5.2",
467                 "platform": "Mac OS 8-X",
468                 "details": [
469                         "1",
470                         "C"
471                 ]
472         },
473         {
474                 "engine": "Misc",
475                 "browser": "NetFront 3.1",
476                 "platform": "Embedded devices",
477                 "details": [
478                         "-",
479                         "C"
480                 ]
481         },
482         {
483                 "engine": "Misc",
484                 "browser": "NetFront 3.4",
485                 "platform": "Embedded devices",
486                 "details": [
487                         "-",
488                         "A"
489                 ]
490         },
491         {
492                 "engine": "Misc",
493                 "browser": "Dillo 0.8",
494                 "platform": "Embedded devices",
495                 "details": [
496                         "-",
497                         "X"
498                 ]
499         },
500         {
501                 "engine": "Misc",
502                 "browser": "Links",
503                 "platform": "Text only",
504                 "details": [
505                         "-",
506                         "X"
507                 ]
508         },
509         {
510                 "engine": "Misc",
511                 "browser": "Lynx",
512                 "platform": "Text only",
513                 "details": [
514                         "-",
515                         "X"
516                 ]
517         },
518         {
519                 "engine": "Misc",
520                 "browser": "IE Mobile",
521                 "platform": "Windows Mobile 6",
522                 "details": [
523                         "-",
524                         "C"
525                 ]
526         },
527         {
528                 "engine": "Misc",
529                 "browser": "PSP browser",
530                 "platform": "PSP",
531                 "details": [
532                         "-",
533                         "C"
534                 ]
535         },
536         {
537                 "engine": "Other browsers",
538                 "browser": "All others",
539                 "platform": "-",
540                 "details": [
541                         "-",
542                         "U"
543                 ]
544         }
545 ]
546         };
547         $('#example').dataTable( oInit );
548         
549         /* Basic checks */
550         oTest.fnWaitTest( 
551                 "Length changing div exists",
552                 null,
553                 function () { return document.getElementById('example_length') != null; }
554         );
555         
556         oTest.fnTest( 
557                 "Filtering div exists",
558                 null,
559                 function () { return document.getElementById('example_filter') != null; }
560         );
561         
562         oTest.fnTest( 
563                 "Information div exists",
564                 null,
565                 function () { return document.getElementById('example_info') != null; }
566         );
567         
568         oTest.fnTest( 
569                 "Pagination div exists",
570                 null,
571                 function () { return document.getElementById('example_paginate') != null; }
572         );
573         
574         oTest.fnTest( 
575                 "Processing div is off by default",
576                 null,
577                 function () { return document.getElementById('example_processing') == null; }
578         );
579         
580         oTest.fnWaitTest( 
581                 "10 rows shown on the first page",
582                 null,
583                 function () { return $('#example tbody tr').length == 10; }
584         );
585         
586         oTest.fnTest( 
587                 "Initial sort occured",
588                 null,
589                 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }
590         );
591         
592         /* Need to use the WaitTest for sorting due to the setTimeout datatables uses */
593         oTest.fnTest( 
594                 "Sorting (first click) on second column",
595                 function () { $('#example thead th:eq(1)').click(); },
596                 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
597         );
598         
599         oTest.fnTest( 
600                 "Sorting (second click) on second column",
601                 function () { $('#example thead th:eq(1)').click(); },
602                 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
603         );
604         
605         oTest.fnTest( 
606                 "Sorting (third click) on second column",
607                 function () { $('#example thead th:eq(1)').click(); },
608                 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
609         );
610         
611         oTest.fnTest( 
612                 "Sorting (first click) on numeric column",
613                 function () { $('#example thead th:eq(3)').click(); },
614                 function () { return $('#example tbody td:eq(3)').html() == "-"; }
615         );
616         
617         oTest.fnTest( 
618                 "Sorting (second click) on numeric column",
619                 function () { $('#example thead th:eq(3)').click(); },
620                 function () { return $('#example tbody td:eq(3)').html() == "522.1"; }
621         );
622         
623         oTest.fnTest( 
624                 "Sorting multi-column (first click)",
625                 function () { 
626                         $('#example thead th:eq(0)').click();
627                         oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); },
628                 function () { var b = 
629                         $('#example tbody td:eq(0)').html() == "Gecko" && 
630                         $('#example tbody td:eq(1)').html() == "Camino 1.0"; return b; }
631         );
632         
633         oTest.fnTest( 
634                 "Sorting multi-column - sorting second column only",
635                 function () { 
636                         $('#example thead th:eq(1)').click(); },
637                 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
638         );
639         
640         /* Basic paging */
641         oTest.fnTest( 
642                 "Paging to second page",
643                 function () { $('#example_next').click(); },
644                 function () { return $('#example tbody td:eq(1)').html() == "IE Mobile"; }
645         );
646         
647         oTest.fnTest( 
648                 "Paging to first page",
649                 function () { $('#example_previous').click(); },
650                 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
651         );
652         
653         oTest.fnTest( 
654                 "Attempting to page back beyond the first page",
655                 function () { $('#example_previous').click(); },
656                 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
657         );
658         
659         /* Changing length */
660         oTest.fnTest( 
661                 "Changing table length to 25 records",
662                 function () { $("select[name=example_length]").val('25').change(); },
663                 function () { return $('#example tbody tr').length == 25; }
664         );
665         
666         oTest.fnTest( 
667                 "Changing table length to 50 records",
668                 function () { $("select[name=example_length]").val('50').change(); },
669                 function () { return $('#example tbody tr').length == 50; }
670         );
671         
672         oTest.fnTest( 
673                 "Changing table length to 100 records",
674                 function () { $("select[name=example_length]").val('100').change(); },
675                 function () { return $('#example tbody tr').length == 57; }
676         );
677         
678         oTest.fnTest( 
679                 "Changing table length to 10 records",
680                 function () { $("select[name=example_length]").val('10').change(); },
681                 function () { return $('#example tbody tr').length == 10; }
682         );
683         
684         /*
685          * Information element
686          */
687         oTest.fnTest(
688                 "Information on zero config",
689                 null,
690                 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
691         );
692         
693         oTest.fnTest(
694                 "Information on second page",
695                 function () { $('#example_next').click(); },
696                 function () { return document.getElementById('example_info').innerHTML == "Showing 11 to 20 of 57 entries"; }
697         );
698         
699         oTest.fnTest(
700                 "Information on third page",
701                 function () { $('#example_next').click(); },
702                 function () { return document.getElementById('example_info').innerHTML == "Showing 21 to 30 of 57 entries"; }
703         );
704         
705         oTest.fnTest(
706                 "Information on last page",
707                 function () {
708                         $('#example_next').click();
709                         $('#example_next').click();
710                         $('#example_next').click();
711                 },
712                 function () { return document.getElementById('example_info').innerHTML == "Showing 51 to 57 of 57 entries"; }
713         );
714         
715         oTest.fnTest(
716                 "Information back on first page",
717                 function () {
718                         $('#example_previous').click();
719                         $('#example_previous').click();
720                         $('#example_previous').click();
721                         $('#example_previous').click();
722                         $('#example_previous').click();
723                 },
724                 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
725         );
726         
727         oTest.fnTest(
728                 "Information with 25 records",
729                 function () { $("select[name=example_length]").val('25').change(); },
730                 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 25 of 57 entries"; }
731         );
732         
733         oTest.fnTest(
734                 "Information with 25 records - second page",
735                 function () { $('#example_next').click(); },
736                 function () { return document.getElementById('example_info').innerHTML == "Showing 26 to 50 of 57 entries"; }
737         );
738         
739         oTest.fnTest(
740                 "Information with 100 records - first page",
741                 function () {
742                         $('#example_previous').click();
743                         $("select[name=example_length]").val('100').change();
744                 },
745                 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 57 of 57 entries"; }
746         );
747         
748         oTest.fnTest(
749                 "Information back to 10 records",
750                 function () {
751                         $('#example_previous').click();
752                         $("select[name=example_length]").val('10').change();
753                 },
754                 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
755         );
756         
757         oTest.fnTest(
758                 "Information with filter 'Win'",
759                 function () { $('#example_filter input').val("Win").keyup(); },
760                 function () { return document.getElementById('example_info').innerHTML == 
761                         "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
762         );
763         
764         oTest.fnTest(
765                 "Information with filter 'Win' second page",
766                 function () { $('#example_next').click(); },
767                 function () { return document.getElementById('example_info').innerHTML == 
768                         "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
769         );
770         
771         oTest.fnTest(
772                 "Information with filter 'Win' last page",
773                 function () {
774                         $('#example_next').click();
775                         $('#example_next').click();
776                 },
777                 function () { return document.getElementById('example_info').innerHTML == 
778                         "Showing 31 to 31 of 31 entries (filtered from 57 total entries)"; }
779         );
780         
781         oTest.fnTest(
782                 "Information with filter 'Win' back to first page",
783                 function () {
784                         $('#example_previous').click();
785                         $('#example_previous').click();
786                         $('#example_previous').click();
787                 },
788                 function () { return document.getElementById('example_info').innerHTML == 
789                         "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
790         );
791         
792         oTest.fnTest(
793                 "Information with filter 'Win' second page - second time",
794                 function () {
795                         $('#example_next').click();
796                 },
797                 function () { return document.getElementById('example_info').innerHTML == 
798                         "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
799         );
800         
801         oTest.fnTest(
802                 "Information with filter increased to 'Win 98'",
803                 function () { $('#example_filter input').val("Win 98").keyup(); },
804                 function () { return document.getElementById('example_info').innerHTML == 
805                         "Showing 1 to 9 of 9 entries (filtered from 57 total entries)"; }
806         );
807         
808         oTest.fnTest(
809                 "Information with filter decreased to 'Win'",
810                 function () { $('#example_filter input').val("Win").keyup(); },
811                 function () { return document.getElementById('example_info').innerHTML == 
812                         "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
813         );
814         
815         oTest.fnTest(
816                 "Information with filter 'Win' second page - third time",
817                 function () {
818                         $('#example_next').click();
819                 },
820                 function () { return document.getElementById('example_info').innerHTML == 
821                         "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
822         );
823         
824         oTest.fnTest(
825                 "Information with filter removed",
826                 function () { $('#example_filter input').val("").keyup(); },
827                 function () { return document.getElementById('example_info').innerHTML == 
828                         "Showing 1 to 10 of 57 entries"; }
829         );
830         
831         
832         /*
833          * Filtering
834          */
835         oTest.fnWaitTest(
836                 "Filter 'W' - rows",
837                 function () { 
838                         /* Reset the table such that the old sorting doesn't mess things up */
839                         oSession.fnRestore();
840                         $('#example').dataTable( oInit );
841                         $('#example_filter input').val("W").keyup(); },
842                 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Gecko"; }
843         );
844         
845         oTest.fnTest(
846                 "Filter 'W' - info",
847                 null,
848                 function () { return document.getElementById('example_info').innerHTML == 
849                         "Showing 1 to 10 of 42 entries (filtered from 57 total entries)"; }
850         );
851         
852         oTest.fnTest(
853                 "Filter 'Wi'",
854                 function () { $('#example_filter input').val("Wi").keyup(); },
855                 function () { return document.getElementById('example_info').innerHTML == 
856                         "Showing 1 to 10 of 32 entries (filtered from 57 total entries)"; }
857         );
858         
859         oTest.fnTest(
860                 "Filter 'Win'",
861                 function () { $('#example_filter input').val("Win").keyup(); },
862                 function () { return document.getElementById('example_info').innerHTML == 
863                         "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
864         );
865         
866         oTest.fnTest(
867                 "Filter 'Win' - sorting column 1",
868                 function () { $('#example thead th:eq(1)').click(); },
869                 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "AOL browser (AOL desktop)"; }
870         );
871         
872         oTest.fnTest(
873                 "Filter 'Win' - sorting column 1 info",
874                 null,
875                 function () { return document.getElementById('example_info').innerHTML == 
876                         "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
877         );
878         
879         oTest.fnTest(
880                 "Filter 'Win' - sorting column 1 reverse",
881                 function () { $('#example thead th:eq(1)').click(); },
882                 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Seamonkey 1.1"; }
883         );
884         
885         oTest.fnTest(
886                 "Filter 'Win XP' - maintaing reverse sorting col 1",
887                 function () { $('#example_filter input').val("Win XP").keyup(); },
888                 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Internet Explorer 7"; }
889         );
890         
891         oTest.fnTest(
892                 "Filter 'Win XP' - sorting col 3",
893                 function () { $('#example thead th:eq(3)').click(); },
894                 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "4"; }
895         );
896         
897         oTest.fnTest(
898                 "Filter 'Win XP' - sorting col 3 - reversed",
899                 function () { $('#example thead th:eq(3)').click(); },
900                 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "7"; }
901         );
902         
903         oTest.fnTest(
904                 "Filter 'Win' - sorting col 3 - reversed info",
905                 null,
906                 function () { return document.getElementById('example_info').innerHTML == 
907                         "Showing 1 to 6 of 6 entries (filtered from 57 total entries)"; }
908         );
909         
910         oTest.fnTest(
911                 "Filter 'nothinghere'",
912                 function () { $('#example_filter input').val("nothinghere").keyup(); },
913                 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == 
914                         "No matching records found"; }
915         );
916         
917         oTest.fnTest(
918                 "Filter 'nothinghere' - info",
919                 null,
920                 function () { return document.getElementById('example_info').innerHTML == 
921                         "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; }
922         );
923         
924         oTest.fnTest(
925                 "Filter back to blank and 1st column sorting",
926                 function () {
927                         $('#example_filter input').val("").keyup();
928                         $('#example thead th:eq(0)').click();
929                 },
930                 function () { return document.getElementById('example_info').innerHTML == 
931                         "Showing 1 to 10 of 57 entries"; }
932         );
933         
934         oTest.fnTest(
935                 "Prefixing a filter entry",
936                 function () {
937                         $('#example_filter input').val("Win").keyup();
938                         $('#example_filter input').val("GeckoWin").keyup();
939                 },
940                 function () { return document.getElementById('example_info').innerHTML == 
941                         "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; }
942         );
943         
944         oTest.fnTest(
945                 "Prefixing a filter entry with space",
946                 function () {
947                         $('#example_filter input').val("Gecko Win").keyup();
948                 },
949                 function () { return document.getElementById('example_info').innerHTML == 
950                         "Showing 1 to 10 of 17 entries (filtered from 57 total entries)"; }
951         );
952         
953         
954         
955         
956         
957         
958         
959         
960         oTest.fnComplete();
961 } );