diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/resources/dynamic-import-credentials-setTimeout-iframe.sub.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/resources/dynamic-import-credentials-setTimeout-iframe.sub.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/resources/dynamic-import-credentials-setTimeout-iframe.sub.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/resources/dynamic-import-credentials-setTimeout-iframe.sub.html new file mode 100644 index 0000000000..ffba141527 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/resources/dynamic-import-credentials-setTimeout-iframe.sub.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="dynamic-import-credentials-helper.sub.js"></script> + +<!-- +The active script at the time of import() is the classic script created by +https://html.spec.whatwg.org/multipage/C/#timer-initialisation-steps +and the active script at the time of setTimeout() is the script elements below, +thus the credentials mode of the fetch options of the script elements below +are used for dynamic import requests. + +setTimeout() calls below can't be wrapped (e.g. by step_timeout()) +because wrapping setTimeout() would set active scripts differently. +--> + +<script> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from classic script (crossOrigin not specified)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "not found", "setTimeout(string) from classic script (crossOrigin not specified)"); +</script> + +<script crossOrigin="anonymous"> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from classic script (crossOrigin=anonymous)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "not found", "setTimeout(string) from classic script (crossOrigin=anonymous)"); +</script> + +<script crossOrigin="use-credentials"> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from classic script (crossOrigin=use-credentials)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "found", "setTimeout(string) from classic script (crossOrigin=use-credentials)"); +</script> + +<script type="module"> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from module script (crossOrigin not specified)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "not found", "setTimeout(string) from module script (crossOrigin not specified)"); +</script> + +<script type="module" crossOrigin="anonymous"> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from module script (crossOrigin=anonymous)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "not found", "setTimeout(string) from module script (crossOrigin=anonymous)"); +</script> + +<script type="module" crossOrigin="use-credentials"> +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "same", "found", "setTimeout(string) from module script (crossOrigin=use-credentials)"); +runTest(setTimeoutWrapper(x => setTimeout(x, 0)), + "cross", "found", "setTimeout(string) from module script (crossOrigin=use-credentials)"); +</script> |