summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html')
-rw-r--r--testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html b/testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html
new file mode 100644
index 0000000000..97d77fcc58
--- /dev/null
+++ b/testing/web-platform/tests/resource-timing/resources/iframe-TAO-crossorigin-port.sub.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script>
+ const url = '{{location[scheme]}}://{{host}}:{{ports[http][1]}}/resource-timing/resources/TAOResponse.py?tao=origin_port_{{ports[http][1]}}';
+ const observe = (list, observer) => {
+ const entry = list.getEntries()[0];
+ const sum = entry.redirectStart +
+ entry.redirectEnd +
+ entry.domainLookupStart +
+ entry.domainLookupEnd +
+ entry.connectStart +
+ entry.connectEnd +
+ entry.secureConnectionStart +
+ entry.requestStart +
+ entry.responseStart +
+ entry.transferSize +
+ entry.encodedBodySize +
+ entry.decodedBodySize;
+
+ const result = sum == 0 ? 'PASS' : 'FAIL';
+ window.top.postMessage(result, '*');
+ }
+ let observer = new PerformanceObserver(observe);
+ observer.observe({ entryTypes: ["resource"] });
+ fetch(url).then(r => r.text());
+</script>
+</body>
+</html>
+
+