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 (4126098473d5)

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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing: image with a hash</title>
<link rel="help" href="http://www.w3.org/TR/resource-timing/#dom-performanceresourcetiming-initiatortype"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/webperftestharness.js"></script>
<script src="resources/webperftestharnessextension.js"></script>
<script>
setup({explicit_done: true});

// explicitly test the namespace before we start testing
test_namespace("getEntriesByType");

function onload_test() {
  if (window.performance.getEntriesByType === undefined) {
    done();
    return;
  }

  const url = "resources/fake_responses.py?tag=" + Math.random() + '#hash=1';
  const image = new Image();
  image.onload = image.onerror = () => {
    const entries = window.performance.getEntriesByType('resource').filter(r => r.initiatorType === 'img');
    test_equals(entries.length, 1, "There should be one entry");
    if (entries.length === 1) {
        test_true(entries[0].name.indexOf('#hash=1') > -1, "There should be a hash in the resource name");
    }
    done();

  }
  image.src = url;
}
window.onload = onload_test;
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that a hash in an image URL is preserved in resource timing API results.</p>
<div id="log"></div>
</body>
</html>