tor-browser

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

invalid-header.https.html (1512B)


      1 <!DOCTYPE html>
      2 <title>Service Worker: respondWith with header value containing a null byte</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/get-host-info.sub.js"></script>
      6 <script src="resources/test-helpers.sub.js"></script>
      7 <script>
      8 promise_test(function(t) {
      9    var SCOPE = 'resources/invalid-header-iframe.https.html';
     10    var SCRIPT = 'resources/invalid-header-worker.js';
     11    var host_info = get_host_info();
     12    return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
     13      .then(function(registration) {
     14          t.add_cleanup(function() {
     15              return service_worker_unregister(t, SCOPE);
     16            });
     17 
     18          return wait_for_state(t, registration.installing, 'activated');
     19        })
     20      .then(function() { return with_iframe(SCOPE); })
     21      .then(function(frame) {
     22          t.add_cleanup(function() {
     23              frame.remove();
     24            });
     25 
     26          var channel = new MessageChannel();
     27          var onMsg = new Promise(function(resolve) {
     28              channel.port1.onmessage = resolve;
     29            });
     30          frame.contentWindow.postMessage({},
     31                                          host_info['HTTPS_ORIGIN'],
     32                                          [channel.port2]);
     33          return onMsg;
     34        })
     35      .then(function(e) {
     36          assert_equals(e.data.results, 'finish');
     37        });
     38  }, 'Verify the response of FetchEvent using XMLHttpRequest');
     39 </script>