Skip to content

Commit

Permalink
Moved and .name return the address of the document (web-platform-test…
Browse files Browse the repository at this point in the history
  • Loading branch information
plehegar authored Feb 22, 2018
1 parent 51bde69 commit a83f934
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
<title>PerformanceObservers: navigation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="performanceobservers.js"></script>
<h1>PerformanceObservers: navigation</h1>
<p>
Navigation will <a href="https://w3c.github.io/performance-timeline/#dfn-queue-a-performanceentry">queue a PerformanceEntry</a>.
</p>
<div id="log"></div>
<script>
async_test(function (t) {
function checkEntry(pes) {
assert_equals(pes.length, 1, "Only one navigation timing entry");
assert_equals(pes[0].entryType, "navigation", "entryType is \"navigation\"");
assert_equals(pes[0].name, window.location.toString(), "name is the address of the document");
}
var observer = new PerformanceObserver(
t.step_func(function (entryList, obs) {
checkEntries(entryList.getEntries(),
[{ entryType: "navigation", name: "document"}]);
checkEntries(entryList.getEntriesByType("navigation"),
[{ entryType: "navigation", name: "document"}]);
checkEntries(entryList.getEntriesByName("document"),
[{ entryType: "navigation", name: "document"}]);
checkEntry(entryList.getEntries());
checkEntry(entryList.getEntriesByType("navigation"));
checkEntry(entryList.getEntriesByName(window.location.toString()));
observer.disconnect();
t.done();
})
Expand Down

0 comments on commit a83f934

Please sign in to comment.