Index: trunk/extensions/WebFonts/tests/qunit/ext.webfonts.tests.js |
— | — | @@ -8,6 +8,8 @@ |
9 | 9 | |
10 | 10 | test( '-- Dynamic font loading', function() { |
11 | 11 | expect( 7 ); |
| 12 | + |
| 13 | + mw.webfonts.fonts = []; |
12 | 14 | var cssRulesLength = document.styleSheets.length; |
13 | 15 | assertTrue( mw.webfonts.addFont( 'Lohit Devanagari' ) , 'Add the Lohit Devanagari font' ); |
14 | 16 | assertTrue( $.inArray( 'Lohit Devanagari', mw.webfonts.fonts ) >= 0 , 'Font loaded' ); |
— | — | @@ -22,6 +24,14 @@ |
23 | 25 | test( '-- Dynamic font loading based on lang attribute', function() { |
24 | 26 | expect( 15 ); |
25 | 27 | |
| 28 | + mw.webfonts.fonts = []; |
| 29 | + mw.config.set( { |
| 30 | + wgLanguage: "en", |
| 31 | + wgUserVariant: "en", |
| 32 | + wgUserLanguage: "en", |
| 33 | + wgPageContentLanguage: "en", |
| 34 | + } ); |
| 35 | + |
26 | 36 | ok( $( 'body' ).append( "<p class='webfonts-testing-lang-attr'>Some Content</p>") ); |
27 | 37 | $testElement = $( 'p.webfonts-testing-lang-attr' ) |
28 | 38 | assertTrue( $testElement !== [], 'Test element added' ) ; |
— | — | @@ -49,6 +59,7 @@ |
50 | 60 | test( '-- Dynamic font loading based on font-family style attribute', function() { |
51 | 61 | expect( 14 ) |
52 | 62 | |
| 63 | + mw.webfonts.fonts = []; |
53 | 64 | ok( $( 'body' ).append( "<p class='webfonts-testing-font-family-style'>Some Content</p>" ) ); |
54 | 65 | var $testElement = $( 'p.webfonts-testing-font-family-style' ); |
55 | 66 | assertTrue( $testElement !== [], 'Test element added' ) ; |