blob: a54fb2aff8eab74e59c5a84fc2bcf487f122ec49 [file] [log] [blame]
Philippe Le Hegareta83f9342018-02-22 14:13:101<!DOCTYPE HTML>
2<meta charset=utf-8>
3<title>PerformanceObservers: navigation</title>
4<script src="/resources/testharness.js"></script>
5<script src="/resources/testharnessreport.js"></script>
6<h1>PerformanceObservers: navigation</h1>
7<p>
8Navigation will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>.
9</p>
10<div id="log"></div>
11<script>
12 async_test(function (t) {
13 function checkEntry(pes) {
14 assert_equals(pes.length, 1, "Only one navigation timing entry");
15 assert_equals(pes[0].entryType, "navigation", "entryType is \"navigation\"");
16 assert_equals(pes[0].name, window.location.toString(), "name is the address of the document");
17 }
18 var observer = new PerformanceObserver(
19 t.step_func(function (entryList, obs) {
20 checkEntry(entryList.getEntries());
21 checkEntry(entryList.getEntriesByType("navigation"));
22 checkEntry(entryList.getEntriesByName(window.location.toString()));
23 observer.disconnect();
24 t.done();
25 })
26 );
27 observer.observe({entryTypes: ["navigation"]});
28 }, "navigation entry is observable");
29</script>