Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Errors
- This test gets skipped with pattern: os == 'android'
- This test failed 8 times in the preceding 30 days. quicksearch this test
- Manifest: browser/components/resistfingerprinting/test/mochitest/mochitest.toml
<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<meta charset="utf-8">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
window.onload = () => {
SimpleTest.waitForFocus(() => {
SpecialPowers.pushPrefEnv({"set":
[
["device.sensors.test.events", true],
["privacy.resistFingerprinting", true],
],
}, doTest);
}, window);
};
function doTest() {
window.addEventListener("devicemotion", () => {
ok(false, "The device motion event should not be fired.");
}, {once: true});
window.addEventListener("TestEvent", () => {
// If we receive this event without receiving a 'devicemotion' event, this means
// the device sensor event has been blocked correctly.
ok(true, "Got the 'TestEvent' event.");
SimpleTest.finish();
}, {once: true});
window.dispatchEvent(new CustomEvent("TestEvent"));
}
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test"></pre>
</body>
</html>