From 6fb9d88ae3ea4cfc1d28d24e49f93573fa3057fc Mon Sep 17 00:00:00 2001 From: Georg Fritzsche Date: Wed, 11 Jul 2012 15:56:01 +0200 Subject: [PATCH] Bug 772143 - Remove carriage returns from TelemetryPing. r=nfroyd --- toolkit/components/telemetry/TelemetryPing.js | 12 ++--- .../tests/unit/test_TelemetryPing.js | 50 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js index ca3a52a6bb47..618484c24615 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -739,12 +739,12 @@ TelemetryPing.prototype = { }, getFlashVersion: function getFlashVersion() { - let host = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); - let tags = host.getPluginTags(); - - for (let i = 0; i < tags.length; i++) { - if (tags[i].name == "Shockwave Flash") - return tags[i].version; + let host = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); + let tags = host.getPluginTags(); + + for (let i = 0; i < tags.length; i++) { + if (tags[i].name == "Shockwave Flash") + return tags[i].version; } return null; diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js index 73ff6170cc18..af22b2dc47ec 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js @@ -328,37 +328,37 @@ function dummyTheme(id) { }; } -// A fake plugin host for testing flash version telemetry -var PluginHost = { - getPluginTags: function(countRef) { - let plugins = [{name: "Shockwave Flash", version: FLASH_VERSION}]; - countRef.value = plugins.length; - return plugins; - }, - - QueryInterface: function(iid) { - if (iid.equals(Ci.nsIPluginHost) - || iid.equals(Ci.nsISupports)) - return this; - - throw Components.results.NS_ERROR_NO_INTERFACE; - } -} - -var PluginHostFactory = { - createInstance: function (outer, iid) { - if (outer != null) - throw Components.results.NS_ERROR_NO_AGGREGATION; - return PluginHost.QueryInterface(iid); - } +// A fake plugin host for testing flash version telemetry +var PluginHost = { + getPluginTags: function(countRef) { + let plugins = [{name: "Shockwave Flash", version: FLASH_VERSION}]; + countRef.value = plugins.length; + return plugins; + }, + + QueryInterface: function(iid) { + if (iid.equals(Ci.nsIPluginHost) + || iid.equals(Ci.nsISupports)) + return this; + + throw Components.results.NS_ERROR_NO_INTERFACE; + } +} + +var PluginHostFactory = { + createInstance: function (outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + return PluginHost.QueryInterface(iid); + } }; const PLUGINHOST_CONTRACTID = "@mozilla.org/plugin/host;1"; const PLUGINHOST_CID = Components.ID("{2329e6ea-1f15-4cbe-9ded-6e98e842de0e}"); function registerFakePluginHost() { - var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); - registrar.registerFactory(PLUGINHOST_CID, "Fake Plugin Host", + var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); + registrar.registerFactory(PLUGINHOST_CID, "Fake Plugin Host", PLUGINHOST_CONTRACTID, PluginHostFactory); }