Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c

This commit is contained in:
Josh Matthews 2018-01-31 09:13:41 -05:00
parent c88dc51d03
commit 0e1caebaf4
791 changed files with 23381 additions and 5501 deletions

View file

@ -17,6 +17,7 @@ let page_loaded = false;
let ol_font_loaded = false;
let ul_font_loaded = false;
let xhr_loaded = false;
let tests_run = false;
function check_finished() {
if (!ul_font_loaded) {
@ -64,6 +65,10 @@ function onload_test() {
}
function perform_test() {
if (tests_run) {
return;
}
tests_run = true;
const context = new PerformanceContext(document.getElementById('frameContext').contentWindow.performance);
const entries = context.getEntriesByType('resource');

View file

@ -0,0 +1,64 @@
importScripts("/resources/testharness.js");
function check(initiatorType, protocol) {
let entries = performance.getEntries();
assert_equals(entries.length, 1);
assert_true(entries[0] instanceof PerformanceEntry);
assert_equals(entries[0].entryType, "resource");
assert_true(entries[0].startTime > 0);
assert_true(entries[0].duration > 0);
assert_true(entries[0] instanceof PerformanceResourceTiming);
assert_equals(entries[0].initiatorType, initiatorType);
assert_equals(entries[0].nextHopProtocol, protocol);
}
async_test(t => {
performance.clearResourceTimings();
// Fetch
fetch("resources/empty.js")
.then(r => r.blob())
.then(blob => {
check("fetch", "http/1.1");
})
// XMLHttpRequest
.then(() => {
return new Promise(resolve => {
performance.clearResourceTimings();
let xhr = new XMLHttpRequest();
xhr.onload = () => {
check("xmlhttprequest", "http/1.1");
resolve();
};
xhr.open("GET", "resources/empty.js");
xhr.send();
});
})
// Sync XMLHttpREquest
.then(() => {
performance.clearResourceTimings();
let xhr = new XMLHttpRequest();
xhr.open("GET", "resources/empty.js", false);
xhr.send();
check("xmlhttprequest", "http/1.1");
})
// ImportScripts
.then(() => {
performance.clearResourceTimings();
importScripts(["resources/empty.js"]);
check("other", "http/1.1");
})
// All done.
.then(() => {
t.done();
});
}, "Performance Resouce Entries in workers");
done();

View file

@ -0,0 +1 @@
/* Nothing here */