Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.client.test.js |
— | — | @@ -5,8 +5,11 @@ |
6 | 6 | ok( jQuery.client, 'jQuery.client defined' ); |
7 | 7 | }); |
8 | 8 | |
9 | | -var uacount = 0, uas = (function() { |
| 9 | +/** Number of user-agent defined */ |
| 10 | +var uacount = 0; |
10 | 11 | |
| 12 | +var uas = (function() { |
| 13 | + |
11 | 14 | // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value) |
12 | 15 | // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/ |
13 | 16 | var uas = { |
— | — | @@ -241,6 +244,8 @@ |
242 | 245 | }); |
243 | 246 | |
244 | 247 | // Example from WikiEditor |
| 248 | +// Make sure to use raw numbers, a string like "7.0" would fail on a |
| 249 | +// version 10 browser since in string comparaison "10" is before "7.0" :) |
245 | 250 | var testMap = { |
246 | 251 | 'ltr': { |
247 | 252 | 'msie': [['>=', 7.0]], |
— | — | @@ -278,7 +283,7 @@ |
279 | 284 | }); |
280 | 285 | |
281 | 286 | test( 'User-agent matches against WikiEditor\'s compatibility map', function() { |
282 | | - expect( uacount * 2 ); |
| 287 | + expect( uacount * 2 ); // double since we test both LTR and RTL |
283 | 288 | |
284 | 289 | // Loop through and run tests |
285 | 290 | $.each( uas, function( agent, data ) { |