fune/browser/base/content/test/trackingUI/browser_trackingUI_appMenu.js
Johann Hofmann b72851d67d Bug 1476224 - Update the Tracking Protection section in the main menu for Content Blocking. r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D2978

--HG--
extra : rebase_source : 0d37900b25bf2e7164ed13e3d6e88bd1bec4e87b
2018-08-09 01:33:38 +02:00

28 lines
1.1 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this);
// Test that the "Tracking Protection" button in the app menu loads about:preferences
add_task(async function testPreferencesButton() {
let cuiTestUtils = new CustomizableUITestUtils(window);
await BrowserTestUtils.withNewTab(gBrowser, async function(browser) {
await cuiTestUtils.openMainMenu();
let loaded = TestUtils.waitForCondition(() => gBrowser.currentURI.spec == "about:preferences#privacy",
"Should open about:preferences.");
document.getElementById("appMenu-tp-label").click();
await loaded;
await ContentTask.spawn(browser, {}, async function() {
let doc = content.document;
let section = await ContentTaskUtils.waitForCondition(
() => doc.querySelector(".spotlight"), "The spotlight should appear.");
is(section.getAttribute("data-subcategory"), "trackingprotection",
"The trackingprotection section is spotlighted.");
});
});
});