tor-browser

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

embed-and-object-are-not-intercepted.https.html (3713B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>embed and object are not intercepted</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/common/get-host-info.sub.js"></script>
      7 <script src="resources/test-helpers.sub.js?pipe=sub"></script>
      8 <body>
      9 <script>
     10 let registration;
     11 
     12 const kScript = 'resources/embed-and-object-are-not-intercepted-worker.js';
     13 const kScope = 'resources/';
     14 
     15 promise_test(t => {
     16    return service_worker_unregister_and_register(t, kScript, kScope)
     17      .then(registration => {
     18          promise_test(() => {
     19              return registration.unregister();
     20            }, 'restore global state');
     21 
     22          return wait_for_state(t, registration.installing, 'activated');
     23        })
     24  }, 'initialize global state');
     25 
     26 promise_test(t => {
     27    let frame;
     28    return with_iframe('resources/embed-is-not-intercepted-iframe.html')
     29      .then(f => {
     30          frame = f;
     31          t.add_cleanup(() => { frame.remove(); });
     32          return frame.contentWindow.test_promise;
     33        })
     34      .then(result => {
     35          assert_equals(result, 'request for embedded content was not intercepted');
     36        });
     37  }, 'requests for EMBED elements of embedded HTML content should not be intercepted by service workers');
     38 
     39 promise_test(t => {
     40    let frame;
     41    return with_iframe('resources/object-is-not-intercepted-iframe.html')
     42      .then(f => {
     43          frame = f;
     44          t.add_cleanup(() => { frame.remove(); });
     45          return frame.contentWindow.test_promise;
     46        })
     47      .then(result => {
     48          assert_equals(result, 'request for embedded content was not intercepted');
     49        });
     50  }, 'requests for OBJECT elements of embedded HTML content should not be intercepted by service workers');
     51 
     52 promise_test(t => {
     53    let frame;
     54    return with_iframe('resources/embed-image-is-not-intercepted-iframe.html')
     55      .then(f => {
     56          frame = f;
     57          t.add_cleanup(() => { frame.remove(); });
     58          return frame.contentWindow.test_promise;
     59        })
     60      .then(result => {
     61          assert_equals(result, 'request was not intercepted');
     62        });
     63  }, 'requests for EMBED elements of an image should not be intercepted by service workers');
     64 
     65 promise_test(t => {
     66    let frame;
     67    return with_iframe('resources/object-image-is-not-intercepted-iframe.html')
     68      .then(f => {
     69          frame = f;
     70          t.add_cleanup(() => { frame.remove(); });
     71          return frame.contentWindow.test_promise;
     72        })
     73      .then(result => {
     74          assert_equals(result, 'request was not intercepted');
     75        });
     76  }, 'requests for OBJECT elements of an image should not be intercepted by service workers');
     77 
     78 promise_test(t => {
     79    let frame;
     80    return with_iframe('resources/object-navigation-is-not-intercepted-iframe.html')
     81      .then(f => {
     82          frame = f;
     83          t.add_cleanup(() => { frame.remove(); });
     84          return frame.contentWindow.test_promise;
     85        })
     86      .then(result => {
     87          assert_equals(result, 'request for embedded content was not intercepted');
     88        });
     89  }, 'post-load navigation of OBJECT elements should not be intercepted by service workers');
     90 
     91 
     92 promise_test(t => {
     93    let frame;
     94    return with_iframe('resources/embed-navigation-is-not-intercepted-iframe.html')
     95      .then(f => {
     96          frame = f;
     97          t.add_cleanup(() => { frame.remove(); });
     98          return frame.contentWindow.test_promise;
     99        })
    100      .then(result => {
    101          assert_equals(result, 'request for embedded content was not intercepted');
    102        });
    103  }, 'post-load navigation of EMBED elements should not be intercepted by service workers');
    104 </script>