tor-browser

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

iso-latin1-header.https.html (1550B)


      1 <!DOCTYPE html>
      2 <title>Service Worker: respondWith with header value containing an ISO Latin 1 (ISO-8859-1 Character Set) string</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/iso-latin1-header-iframe.html';
     10    var SCRIPT = 'resources/iso-latin1-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          var channel = new MessageChannel();
     23          t.add_cleanup(function() {
     24              frame.remove();
     25            });
     26 
     27          var onMsg = new Promise(function(resolve) {
     28              channel.port1.onmessage = resolve;
     29            });
     30 
     31          frame.contentWindow.postMessage({},
     32                                          host_info['HTTPS_ORIGIN'],
     33                                          [channel.port2]);
     34          return onMsg;
     35        })
     36      .then(function(e) {
     37          assert_equals(e.data.results, 'finish');
     38        });
     39  }, 'Verify the response of FetchEvent using XMLHttpRequest');
     40 </script>