blob: 285cb2e6e31a0df259d980792ffffc195a9f54a8 [file] [log] [blame] [edit]
<!DOCTYPE html>
<meta charset="euc-jp"/>
<title>WebBundle subresource loading with non utf-8 query encoding and encoded src</title>
<link
rel="help"
href="https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<link
rel="webbundle"
href="../resources/wbn/non-utf8-query-encoding.wbn"
resources="https://web-platform.test:8444/web-bundle/resources/wbn/static-element/resources/script.js?x=��"
/>
<script id="script" src="/web-bundle/resources/wbn/static-element/resources/script.js?x=%A4%A2"></script>
<script>
// This test is using a non-ascii character whose Unicode point is U+3042.
// URL encode (in EUC-JP) of the character is "%A4%A2".
const onLoadPromise = new Promise((resolve) => {
window.addEventListener('load', resolve, false);
});
promise_test(async () => {
await onLoadPromise;
assert_equals(resources_script_result, 'loaded from webbundle');
}, "Query encoding should be correctly handled in non utf-8 encoding " +
"document when script src is encoded.");
</script>
</body>