5 <script src="../../../fast/js/resources/js-test-pre.js"></script>
7 if (window.layoutTestController) {
8 layoutTestController.overridePreference("WebKitJavaEnabled", "1");
9 layoutTestController.waitUntilDone();
13 <body onload="onload()">
15 <div id="console"></div>
18 classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
21 <param name="codebase" value="../../../java">
22 <param name="code" value="lc3.class">
23 <param name="archive" value="jstests.jar">
27 codebase="../../../java"
29 type="application/x-java-applet"
42 window.applet = document.getElementsByTagName("embed")[0];
43 if (!applet.createQAObject)
44 window.applet = document.getElementsByTagName("object")[0];
49 function shouldBeWithErrorCheck(_a, _b)
51 // Don't want full stack traces from Java exceptions.
52 if (window.layoutTestController) {
56 if (/Caused by: /.test(ex)) {
57 testFailed(_a + ": Exception raised");
67 testFailed(_b + ": " + ex);
71 if (b_eval == "error")
77 function wkTestStringToJavaByteArray(string)
79 return applet.stringToByteArray(string);
82 function appendScript(text)
84 var el = document.createElement("script")
85 el.appendChild = document.createTextNode(text);
86 document.body.appendChild(el);
92 var req = new XMLHttpRequest();
93 req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
94 if (req.overrideMimeType)
95 req.overrideMimeType("text/plain");
98 if (!req.responseText.length)
99 throw "could not load test script";
101 var scriptElement = document.createElement("script")
102 scriptElement.appendChild(document.createTextNode(
103 req.responseText + "\n"));
104 document.body.appendChild(scriptElement);
106 testFailed("Could not run test: " + ex);
109 scriptElement = document.createElement("script")
110 scriptElement.src = '../../../fast/js/resources/js-test-post-async.js'
111 document.body.appendChild(scriptElement);