browser_bug234628-4.js (1071B)
1 function test() { 2 var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/"; 3 runCharsetTest( 4 rootDir + "file_bug234628-4.html", 5 afterOpen, 6 afterChangeCharset 7 ); 8 } 9 10 function afterOpen() { 11 is( 12 content.document.documentElement.textContent.indexOf("\u20AC"), 13 132, 14 "Parent doc should be windows-1252 initially" 15 ); 16 17 is( 18 content.frames[0].document.documentElement.textContent.indexOf("\u20AC"), 19 79, 20 "Child doc should be utf-8 initially" 21 ); 22 } 23 24 function afterChangeCharset() { 25 is( 26 content.document.documentElement.textContent.indexOf("\u20AC"), 27 132, 28 "Parent doc should decode as windows-1252 subsequently" 29 ); 30 is( 31 content.frames[0].document.documentElement.textContent.indexOf("\u20AC"), 32 79, 33 "Child doc should decode as utf-8 subsequently" 34 ); 35 36 is( 37 content.document.characterSet, 38 "windows-1252", 39 "Parent doc should report windows-1252 subsequently" 40 ); 41 is( 42 content.frames[0].document.characterSet, 43 "UTF-8", 44 "Child doc should report UTF-8 subsequently" 45 ); 46 }