Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: toolkit/components/url-classifier/tests/mochitest/chrome.toml
<!DOCTYPE HTML>
<html>
<head>
<title>Test the URI Classifier</title>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
const {UrlClassifierTestUtils} = ChromeUtils.importESModule(
);
SpecialPowers.addPermission("trackingprotection",
Ci.nsIPermissionManager.ALLOW_ACTION,
async function clearPermissions() {
await SpecialPowers.removePermission("trackingprotection",
ok(!await SpecialPowers.testPermission("trackingprotection",
Ci.nsIPermissionManager.ALLOW_ACTION,
}
SpecialPowers.pushPrefEnv(
{"set": [["urlclassifier.trackingTable", "moztest-track-simple"],
["privacy.trackingprotection.enabled", true],
["privacy.trackingprotection.testing.report_blocked_node", true],
["channelclassifier.allowlist_example", true],
["dom.security.skip_remote_script_assertion_in_system_priv_context", true]]},
test);
function test() {
SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
UrlClassifierTestUtils.addTestTrackers().then(() => {
document.getElementById("testFrame").src = "allowlistAnnotatedFrame.html";
});
}
// Expected finish() call is in "allowlistedAnnotatedFrame.html".
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
</body>
</html>