Backed out changeset 0a3385aaff01 (
bug 1015988) for mochitest-bc orange.
--- a/browser/components/loop/content/js/panel.js
+++ b/browser/components/loop/content/js/panel.js
@@ -349,21 +349,17 @@ loop.panel = (function(_, mozL10n) {
this.handleLinkExfiltration(event);
// XXX the mozLoop object should be passed as a prop, to ease testing and
// using a fake implementation in UI components showcase.
navigator.mozLoop.copyString(this.state.callUrl);
this.setState({copied: true});
},
handleLinkExfiltration: function(event) {
- try {
- navigator.mozLoop.telemetryAdd("LOOP_CLIENT_CALL_URL_SHARED", true);
- } catch (err) {
- console.error("Error recording telemetry", err);
- }
+ // TODO Bug 1015988 -- Increase link exfiltration telemetry count
if (this.state.callUrlExpiry) {
navigator.mozLoop.noteCallUrlExpiry(this.state.callUrlExpiry);
}
},
render: function() {
// XXX setting elem value from a state (in the callUrl input)
// makes it immutable ie read only but that is fine in our case.
--- a/browser/components/loop/content/js/panel.jsx
+++ b/browser/components/loop/content/js/panel.jsx
@@ -349,21 +349,17 @@ loop.panel = (function(_, mozL10n) {
this.handleLinkExfiltration(event);
// XXX the mozLoop object should be passed as a prop, to ease testing and
// using a fake implementation in UI components showcase.
navigator.mozLoop.copyString(this.state.callUrl);
this.setState({copied: true});
},
handleLinkExfiltration: function(event) {
- try {
- navigator.mozLoop.telemetryAdd("LOOP_CLIENT_CALL_URL_SHARED", true);
- } catch (err) {
- console.error("Error recording telemetry", err);
- }
+ // TODO Bug 1015988 -- Increase link exfiltration telemetry count
if (this.state.callUrlExpiry) {
navigator.mozLoop.noteCallUrlExpiry(this.state.callUrlExpiry);
}
},
render: function() {
// XXX setting elem value from a state (in the callUrl input)
// makes it immutable ie read only but that is fine in our case.
--- a/browser/components/loop/test/desktop-local/panel_test.js
+++ b/browser/components/loop/test/desktop-local/panel_test.js
@@ -31,17 +31,16 @@ describe("loop.panel", function() {
get locale() {
return "en-US";
},
setLoopCharPref: sandbox.stub(),
getLoopCharPref: sandbox.stub().returns("unseen"),
copyString: sandbox.stub(),
noteCallUrlExpiry: sinon.spy(),
composeEmail: sinon.spy(),
- telemetryAdd: sinon.spy(),
contacts: {
getAll: function(callback) {
callback(null, []);
},
on: sandbox.stub()
}
};
@@ -399,37 +398,16 @@ describe("loop.panel", function() {
TestUtils.Simulate.click(view.getDOMNode().querySelector(".button-copy"));
sinon.assert.calledOnce(navigator.mozLoop.noteCallUrlExpiry);
sinon.assert.calledWithExactly(navigator.mozLoop.noteCallUrlExpiry,
6000);
});
- it("should call mozLoop.telemetryAdd when the url is copied via button",
- function() {
- var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
- notifications: notifications,
- client: fakeClient
- }));
- view.setState({
- pending: false,
- copied: false,
- callUrl: "http://example.com",
- callUrlExpiry: 6000
- });
-
- TestUtils.Simulate.click(view.getDOMNode().querySelector(".button-copy"));
-
- sinon.assert.calledOnce(navigator.mozLoop.telemetryAdd);
- sinon.assert.calledWith(navigator.mozLoop.telemetryAdd,
- "LOOP_CLIENT_CALL_URL_SHARED",
- true);
- });
-
it("should note the call url expiry when the url is emailed",
function() {
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
notifications: notifications,
client: fakeClient
}));
view.setState({
pending: false,
@@ -440,37 +418,16 @@ describe("loop.panel", function() {
TestUtils.Simulate.click(view.getDOMNode().querySelector(".button-email"));
sinon.assert.calledOnce(navigator.mozLoop.noteCallUrlExpiry);
sinon.assert.calledWithExactly(navigator.mozLoop.noteCallUrlExpiry,
6000);
});
- it("should call mozLoop.telemetryAdd when the url is emailed",
- function() {
- var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
- notifications: notifications,
- client: fakeClient
- }));
- view.setState({
- pending: false,
- copied: false,
- callUrl: "http://example.com",
- callUrlExpiry: 6000
- });
-
- TestUtils.Simulate.click(view.getDOMNode().querySelector(".button-email"));
-
- sinon.assert.calledOnce(navigator.mozLoop.telemetryAdd);
- sinon.assert.calledWith(navigator.mozLoop.telemetryAdd,
- "LOOP_CLIENT_CALL_URL_SHARED",
- true);
- });
-
it("should note the call url expiry when the url is copied manually",
function() {
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
notifications: notifications,
client: fakeClient
}));
view.setState({
pending: false,
@@ -482,38 +439,16 @@ describe("loop.panel", function() {
var urlField = view.getDOMNode().querySelector("input[type='url']");
TestUtils.Simulate.copy(urlField);
sinon.assert.calledOnce(navigator.mozLoop.noteCallUrlExpiry);
sinon.assert.calledWithExactly(navigator.mozLoop.noteCallUrlExpiry,
6000);
});
- it("should call mozLoop.telemetryAdd when the url is copied manually",
- function() {
- var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
- notifications: notifications,
- client: fakeClient
- }));
- view.setState({
- pending: false,
- copied: false,
- callUrl: "http://example.com",
- callUrlExpiry: 6000
- });
-
- var urlField = view.getDOMNode().querySelector("input[type='url']");
- TestUtils.Simulate.copy(urlField);
-
- sinon.assert.calledOnce(navigator.mozLoop.telemetryAdd);
- sinon.assert.calledWith(navigator.mozLoop.telemetryAdd,
- "LOOP_CLIENT_CALL_URL_SHARED",
- true);
- });
-
it("should notify the user when the operation failed", function() {
fakeClient.requestCallUrl = function(_, cb) {
cb("fake error");
};
sandbox.stub(notifications, "errorL10n");
var view = TestUtils.renderIntoDocument(loop.panel.CallUrlResult({
notifications: notifications,
client: fakeClient
--- a/browser/components/loop/test/mochitest/browser_mozLoop_telemetry.js
+++ b/browser/components/loop/test/mochitest/browser_mozLoop_telemetry.js
@@ -8,17 +8,16 @@
add_task(loadLoopPanel);
/**
* Tests that boolean histograms exist and can be updated.
*/
add_task(function* test_mozLoop_telemetryAdd_boolean() {
for (let histogramId of [
"LOOP_CLIENT_CALL_URL_REQUESTS_SUCCESS",
- "LOOP_CLIENT_CALL_URL_SHARED",
]) {
let snapshot = Services.telemetry.getHistogramById(histogramId).snapshot();
let initialFalseCount = snapshot.counts[0];
let initialTrueCount = snapshot.counts[1];
for (let value of [false, false, true]) {
gMozLoopAPI.telemetryAdd(histogramId, value);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -6742,21 +6742,16 @@
"n_values": 3,
"description": "Doorhanger shown = 0, Disable = 1, Enable = 2"
},
"LOOP_CLIENT_CALL_URL_REQUESTS_SUCCESS": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Stores 1 if generating a call URL succeeded, and 0 if it failed."
},
- "LOOP_CLIENT_CALL_URL_SHARED": {
- "expires_in_version": "never",
- "kind": "boolean",
- "description": "Stores 1 every time the URL is copied or shared."
- },
"E10S_AUTOSTART": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Whether a session is set to autostart e10s windows"
},
"E10S_WINDOW": {
"expires_in_version": "never",
"kind": "boolean",