B2G/gecko/dom/plugins/test/unit/test_bug455213.js
// Writes out some plugin registry to the profile
Writes out some plugin registry to the profile
Writes out some plugin registry to the profile
function write_registry(version, info) {
  var header = "Generated File. Do not edit.\n\n";
  header += "[HEADER]\n";
  header += "Version" + DELIM + version + DELIM + "$\n\n";
  header += "[PLUGINS]\n";
  var registry = gProfD.clone();
  registry.append("pluginreg.dat");
  var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
                           .createInstance(Components.interfaces.nsIFileOutputStream);
  foStream.init(registry, 0x02 | 0x08 | 0x20, 0666, 0);
  var charset = "UTF-8"; 
  var os = Cc["@mozilla.org/intl/converter-output-stream;1"].
           createInstance(Ci.nsIConverterOutputStream);
  os.init(foStream, charset, 0, 0x0000);
  os.writeString(header);
  os.writeString(info);
  os.close();
}
function write_registry ( version , info ) { var header = "Generated File. Do not edit.\n\n" ; header += "[HEADER]\n" ; header += "Version" + DELIM + version + DELIM + "$\n\n" ; header += "[PLUGINS]\n" ; var registry = gProfD . clone ( ) ; registry . append ( "pluginreg.dat" ) ; var foStream = Components . classes [ "@mozilla.org/network/file-output-stream;1" ] . createInstance ( Components . interfaces . nsIFileOutputStream ) ; foStream . init ( registry , 0x02 | 0x08 | 0x20 , 0666 , 0 ) ; var charset = "UTF-8" ; var os = Cc [ "@mozilla.org/intl/converter-output-stream;1" ] . createInstance ( Ci . nsIConverterOutputStream ) ; os . init ( foStream , charset , 0 , 0x0000 ) ; os . writeString ( header ) ; os . writeString ( info ) ; os . close ( ) ; }
Writes out some plugin registry to the profile
Writes out some plugin registry to the profile
// write, create, truncate // Can be any character encoding name that Mozilla supports