tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

global_privacy_control.testdriver.html (1393B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <title>GPC Testdriver Validation</title>
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src='/resources/testdriver-vendor.js'></script>
      8 <script>
      9 
     10 promise_test(async t => {
     11    // We do not test the initial value deliberately
     12    const getInitial = await test_driver.get_global_privacy_control();
     13    assert_true(getInitial.gpc === true || getInitial.gpc === false, "Initial value of GPC must be a boolean true or false.")
     14    const setTrue = await test_driver.set_global_privacy_control(true);
     15    assert_true(setTrue.gpc, "Setting a true global privacy control value results in a true value returned after awaiting.");
     16    const getTrue = await test_driver.get_global_privacy_control();
     17    assert_true(getTrue.gpc, "Reading the global privacy control value after set to true results in a true value after awaiting.");
     18    const setFalse = await test_driver.set_global_privacy_control(false);
     19    assert_false(setFalse.gpc, "Setting a false global privacy control value results in a false value returned after awaiting.");
     20    const getFalse = await test_driver.get_global_privacy_control();
     21    assert_false(getFalse.gpc, "Reading the global privacy control value after set to false results in a false value after awaiting.");
     22 });
     23 
     24 </script>