summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/tests/unit/test_resistFingerprinting_date_now.js
blob: 1acd6c586cbfd030ed655147a725ff0b5d721913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Services.prefs.setBoolPref("privacy.resistFingerprinting", true);
registerCleanupFunction(() => {
  Services.prefs.clearUserPref("privacy.resistFingerprinting");
});

add_task(function test_sandbox_rfp() {
  var sb = Cu.Sandbox('http://example.com');
  var date = Cu.evalInSandbox('Date.now()', sb);
  ok(date > 1672553000000, "Date.now() works with resistFingerprinting");
});

add_task(function test_sandbox_system() {
  var sb = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal());
  var date = Cu.evalInSandbox('Date.now()', sb);
  ok(date > 1672553000000, "Date.now() works with systemprincipal");
});