tor-browser

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

default.html (1396B)


      1 <!doctype html>
      2 <html>
      3 <head>
      4  <meta charset=utf-8>
      5  <title>Test for default cookie path</title>
      6  <meta name=help href="http://tools.ietf.org/html/rfc6265#section-5.1.4">
      7 
      8  <script src="/resources/testharness.js"></script>
      9  <script src="/resources/testharnessreport.js"></script>
     10  <script src="/resources/testdriver.js"></script>
     11  <script src="/resources/testdriver-vendor.js"></script>
     12 </head>
     13 <body>
     14 <div id=log></div>
     15 
     16 <script>
     17 var body = document.getElementsByTagName('body')[0];
     18 var createIframe = function (src, done) {
     19  var iframe = document.createElement('iframe');
     20  iframe.src = src;
     21  body.appendChild(iframe);
     22  iframe.onload = function () {
     23    done(iframe);
     24  };
     25 };
     26 
     27 async_test(function (t) {
     28  var iframe;
     29  var verify = t.step_func(function () {
     30    assert_true(
     31      !!iframe.contentWindow.isCookieSet('cookies-path-default'),
     32      'cookie can be retrieved from expected path'
     33    );
     34    iframe.contentWindow.expireCookies().then(t.step_func(function () {
     35      assert_false(
     36        !!iframe.contentWindow.isCookieSet('cookies-path-default'),
     37        'cookie can be referenced using the expected path'
     38      );
     39      t.done();
     40    }));
     41  });
     42 
     43  createIframe('/cookies/resources/echo-cookie.html', t.step_func(function (_iframe) {
     44    iframe = _iframe;
     45 
     46    createIframe('/cookies/resources/set.py?cookies-path-default=1', verify);
     47  }));
     48 });
     49 </script>
     50 </body>
     51 </html>