diff --git a/resource-timing/resources/resource-loaders.js b/resource-timing/resources/resource-loaders.js index c076ccc51004b58..99a2c28d2b3b27d 100644 --- a/resource-timing/resources/resource-loaders.js +++ b/resource-timing/resources/resource-loaders.js @@ -120,5 +120,14 @@ const load = { } } xhr.send(); + }, + + xhr_async: path => { + const xhr = new XMLHttpRequest(); + xhr.open("GET", path) + xhr.send(); + return new Promise(resolve => { + xhr.onload = xhr.onerror = resolve; + }); } }; diff --git a/resource-timing/xhr-resource-timing.html b/resource-timing/xhr-resource-timing.html new file mode 100644 index 000000000000000..6f8f3331861062a --- /dev/null +++ b/resource-timing/xhr-resource-timing.html @@ -0,0 +1,29 @@ + + + + +This test validates that a failed cross-origin fetch creates an opaque network timing entry. + + + + + + + + + + + + \ No newline at end of file