1 /* Tests getting properties from string bundles with incorrect encoding.
2 * The string bundle contains one ascii property, one UTF-8 and one Latin-1.
3 * Expected behaviour is that the whole string bundle should be rejected and
4 * all GetStringFromName calls should fail.
7 const name_ascii = "asciiProperty";
8 const value_ascii = "";
10 const name_utf8 = "utf8Property";
11 const value_utf8 = "";
13 const name_latin1 = "latin1";
14 const value_latin1 = "";
19 Components.classes["@mozilla.org/intl/stringbundle;1"]
20 .getService(Components.interfaces.nsIStringBundleService);
22 var bundle = StringBundle.createBundle("resource://gre/res/397093.properties");
24 var bundle_ascii="", bundle_utf8="", bundle_latin1="";
26 bundle_ascii = bundle.GetStringFromName(name_ascii);
28 do_check_eq(bundle_ascii, value_ascii);
31 bundle_utf8 = bundle.GetStringFromName(name_utf8);
33 do_check_eq(bundle_utf8, value_utf8);
36 bundle_latin1 = bundle.GetStringFromName(name_latin1);
38 do_check_eq(bundle_latin1, value_latin1);