0bbb60a77f1adf0348e06a6fbcf359770ca530c1
[WebKit-https.git] / LayoutTests / fast / loader / cache-encoding.html
1 <script src="../../resources/js-test-pre.js"></script>
2 <script>
3 jsTestIsAsync = true;
4
5 description("First load a script with a wrong charset then again with the right one. Second attempt should work and 'scriptSuccess' should be set to true. 'successfullyParsed' will be undefined.");
6
7 function appendScriptWithCharset(charset, onload)
8 {
9     var script = document.createElement("script");
10     script.src = "resources/success.js";
11     script.setAttribute("charset", charset);
12     script.onload = onload;
13     script.onerror = onload;
14     document.body.appendChild(script);
15 }
16
17 function test()
18 {
19     appendScriptWithCharset("utf-16", function () {
20         appendScriptWithCharset("utf-8", function () {
21             shouldBeTrue("scriptSuccess");
22             finishJSTest();
23         });
24     });
25 }
26 </script>
27 <body onload="test()">
28 <script src="../../resources/js-test-post.js"></script>