Bug 1604563 - Rename trackingProtection trigger event to contentBlocking r=k88hudson

Differential Revision: https://phabricator.services.mozilla.com/D57628

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrei Oprea 2019-12-20 16:25:51 +00:00
parent 705e153788
commit 33f5763166
3 changed files with 28 additions and 28 deletions

View file

@ -442,7 +442,7 @@ this.ASRouterTriggerListeners = new Map([
* on content blocked event
*/
[
"trackingProtection",
"contentBlocking",
{
_initialized: false,
_triggerHandler: null,
@ -504,7 +504,7 @@ this.ASRouterTriggerListeners = new Map([
const { browser, host, event } = aSubject.wrappedJSObject;
if (this._events.filter(e => (e & event) === e).length) {
this._triggerHandler(browser, {
id: "trackingProtection",
id: "contentBlocking",
param: {
host,
type: event,
@ -521,7 +521,7 @@ this.ASRouterTriggerListeners = new Map([
Services.wm.getMostRecentBrowserWindow().gBrowser
.selectedBrowser,
{
id: "trackingProtection",
id: "contentBlocking",
context: {
pageLoad: this._sessionPageLoad,
},

View file

@ -665,7 +665,7 @@ const CFR_MESSAGES = [
custom: [{ period: 2 * 86400 * 1000, cap: 1 }],
},
trigger: {
id: "trackingProtection",
id: "contentBlocking",
params: [
Ci.nsIWebProgressListener.STATE_BLOCKED_SOCIALTRACKING_CONTENT,
Ci.nsIWebProgressListener.STATE_LOADED_SOCIALTRACKING_CONTENT |
@ -723,7 +723,7 @@ const CFR_MESSAGES = [
custom: [{ period: 2 * 86400 * 1000, cap: 1 }],
},
trigger: {
id: "trackingProtection",
id: "contentBlocking",
params: [Ci.nsIWebProgressListener.STATE_BLOCKED_FINGERPRINTING_CONTENT],
},
},
@ -777,7 +777,7 @@ const CFR_MESSAGES = [
custom: [{ period: 2 * 86400 * 1000, cap: 1 }],
},
trigger: {
id: "trackingProtection",
id: "contentBlocking",
params: [Ci.nsIWebProgressListener.STATE_BLOCKED_CRYPTOMINING_CONTENT],
},
},
@ -803,10 +803,10 @@ const CFR_MESSAGES = [
},
targeting: "pageLoad >= 4",
frequency: {
lifetime: 7, // Length of privacy.trackingprotection.cfr-milestone.milestones pref
lifetime: 7, // Length of privacy.contentBlocking.cfr-milestone.milestones pref
},
trigger: {
id: "trackingProtection",
id: "contentBlocking",
params: ["ContentBlockingMilestone"],
},
},

View file

@ -201,7 +201,7 @@ add_task(async function check_newSavedLogin_listener() {
);
});
add_task(async function check_trackingProtection_listener() {
add_task(async function check_contentBlocking_listener() {
const TEST_URL =
"https://example.com/browser/browser/components/newtab/test/browser/red_page.html";
@ -224,7 +224,7 @@ add_task(async function check_trackingProtection_listener() {
param: { host, type },
context: { pageLoad },
} = trigger;
is(id, "trackingProtection", "should match event name");
is(id, "contentBlocking", "should match event name");
is(host, TEST_URL, "should match test URL");
is(
bindEvents.filter(e => (type & e) === e).length,
@ -236,18 +236,18 @@ add_task(async function check_trackingProtection_listener() {
observerEvent += 1;
pageLoadSum = pageLoad;
};
const trackingProtectionListener = ASRouterTriggerListeners.get(
"trackingProtection"
const contentBlockingListener = ASRouterTriggerListeners.get(
"contentBlocking"
);
// Previously initialized by the Router
trackingProtectionListener.uninit();
contentBlockingListener.uninit();
await trackingProtectionListener.init(triggerHandler, bindEvents);
await contentBlockingListener.init(triggerHandler, bindEvents);
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtection(browser) {
async function triggercontentBlocking(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {
@ -266,7 +266,7 @@ add_task(async function check_trackingProtection_listener() {
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtection(browser) {
async function triggercontentBlocking(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {
@ -321,11 +321,11 @@ add_task(async function check_trackingProtection_listener() {
);
// Uninitialise listener
trackingProtectionListener.uninit();
contentBlockingListener.uninit();
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtectionAfterUninit(browser) {
async function triggercontentBlockingAfterUninit(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {
@ -343,7 +343,7 @@ add_task(async function check_trackingProtection_listener() {
);
});
add_task(async function check_trackingProtectionMilestone_listener() {
add_task(async function check_contentBlockingMilestone_listener() {
const TEST_URL =
"https://example.com/browser/browser/components/newtab/test/browser/red_page.html";
@ -353,23 +353,23 @@ add_task(async function check_trackingProtectionMilestone_listener() {
id,
param: { host },
} = trigger;
is(id, "trackingProtection", "should match event name");
is(id, "contentBlocking", "should match event name");
is(host, "ContentBlockingMilestone", "Should be the correct event type");
observerEvent += 1;
};
const trackingProtectionListener = ASRouterTriggerListeners.get(
"trackingProtection"
const contentBlockingListener = ASRouterTriggerListeners.get(
"contentBlocking"
);
// Previously initialized by the Router
trackingProtectionListener.uninit();
contentBlockingListener.uninit();
// Initialise listener
trackingProtectionListener.init(triggerHandler, ["ContentBlockingMilestone"]);
contentBlockingListener.init(triggerHandler, ["ContentBlockingMilestone"]);
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtection(browser) {
async function triggercontentBlocking(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {
@ -386,7 +386,7 @@ add_task(async function check_trackingProtectionMilestone_listener() {
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtection(browser) {
async function triggercontentBlocking(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {
@ -406,11 +406,11 @@ add_task(async function check_trackingProtectionMilestone_listener() {
);
// Uninitialise listener
trackingProtectionListener.uninit();
contentBlockingListener.uninit();
await BrowserTestUtils.withNewTab(
TEST_URL,
async function triggerTrackingProtectionAfterUninit(browser) {
async function triggercontentBlockingAfterUninit(browser) {
Services.obs.notifyObservers(
{
wrappedJSObject: {