DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (6663d3dc883b)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name=timeout content=long>
<title>Resource Timing - Check that nextHopProtocol is TAO protected</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script>

const addFrame = url => {
  const iframe = document.createElement("iframe");
  iframe.src = url;
  document.body.appendChild(iframe);
};

const host_info = get_host_info();

// Add iframe to remote origin - page without TAO
promise_test(t => {
  return new Promise((resolve, reject) => {
    const observer = new PerformanceObserver(list => {
      const entries = list.getEntries();
      for (entry of entries) {
        if (entry.name.includes("blank_page_green.htm")) {
          observer.disconnect();
          // Observe its performance entry to make sure nextHopProtocol is empty
          if (entry.nextHopProtocol != "") {
            reject("nextHopProtocol should be the empty string");
          }
          resolve();
        }
      }
    });
    observer.observe({entryTypes: ["resource"]});
    addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/blank_page_green.htm");
  });
}, "Add TAO-less iframe to remote origin. Make sure nextHopProtocol is the empty string");

// Add iframe to remote origin - page with TAO
promise_test(t => {
  return new Promise((resolve, reject) => {
    const observer = new PerformanceObserver(list => {
      const entries = list.getEntries();
      for (entry of entries) {
        if (entry.name.includes("blank-with-tao.html")) {
          observer.disconnect();
          // Observe its performance entry to make sure nextHopProtocol is empty
          if (entry.nextHopProtocol == "") {
            reject("nextHopProtocol should not be the empty string");
          }
          resolve();
        }
      }
    });
    observer.observe({entryTypes: ["resource"]});
    addFrame(host_info.HTTPS_REMOTE_ORIGIN + "/resource-timing/resources/blank-with-tao.html");
  });
}, "Add TAO iframe to remote origin. Make sure nextHopProtocol is not the empty string");
</script>
</body>
</html>