| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <meta charset="utf-8" /> |
| <meta name="timeout" content="long"> |
| <link rel="author" title="Noam Rosenthal" href="noam@chromium.org"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/common/get-host-info.sub.js"></script> |
| <script src="resources/entry-invariants.js"></script> |
| </head> |
| <body> |
| <script> |
| const {REMOTE_ORIGIN} = get_host_info(); |
| |
| promise_test(async t => { |
| const success_url = new URL("/resource-timing/resources/object-frame-options-200.asis", REMOTE_ORIGIN).href; |
| const fail_url = new URL("/resource-timing/resources/object-frame-options-403.asis", REMOTE_ORIGIN).href; |
| const load_object = async url => { |
| const object = document.createElement("object"); |
| object.data = url; |
| document.body.appendChild(object); |
| t.add_cleanup(() => object.remove()); |
| await new Promise(resolve => { |
| object.onload = object.onerror = resolve; |
| }); |
| }; |
| |
| await Promise.all([success_url, fail_url].map(load_object)); |
| assert_equals(performance.getEntriesByName(success_url).length, 1); |
| assert_equals(performance.getEntriesByName(fail_url).length, 1); |
| }, "Test that object elements with X-Frame-Options: Deny produce resource timing entries"); |
| </script> |
| </body> |
| </html> |