Commit a76314c2 authored by Johann Hofmann's avatar Johann Hofmann
Browse files

Bug 1573498 - Add SocialTracking.updateCategoryItem(). r=nhnt11

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

--HG--
extra : moz-landing-system : lando
parent 85a80838
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -982,8 +982,10 @@ var SocialTracking = {
      this,
      "enabled",
      this.PREF_ENABLED,
      false
      false,
      this.updateCategoryItem.bind(this)
    );
    this.updateCategoryItem();
    XPCOMUtils.defineLazyPreferenceGetter(
      this,
      "uiEnabled",
@@ -1019,6 +1021,10 @@ var SocialTracking = {
    );
  },

  updateCategoryItem() {
    this.categoryItem.classList.toggle("blocked", this.enabled);
  },

  isBlocking(state) {
    let cookieTrackerBlocked =
      (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER) != 0;
+5 −1
Original line number Diff line number Diff line
@@ -121,7 +121,11 @@ async function testSubview(hasException) {
  let categoryItem = document.getElementById(
    "protections-popup-category-socialblock"
  );
  ok(BrowserTestUtils.is_visible(categoryItem), "TP category item is visible");
  ok(BrowserTestUtils.is_visible(categoryItem), "STP category item is visible");
  ok(
    categoryItem.classList.contains("blocked"),
    "STP category item is blocked"
  );
  let subview = document.getElementById("protections-popup-socialblockView");
  let viewShown = BrowserTestUtils.waitForEvent(subview, "ViewShown");
  categoryItem.click();