blob: c1f1681040ea93b3430cfc079c8372a3dd1e6749 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../../fast/js/resources/js-test-pre.js"></script>
<script>
if (window.layoutTestController) {
layoutTestController.overridePreference("WebKitJavaEnabled", "1");
layoutTestController.waitUntilDone();
}
</script>
</head>
<body onload="onload()">
<div id="console"></div>
<object
classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
width=500
height=200
<param name="codebase" value="../../../java">
<param name="code" value="lc3.class">
<param name="archive" value="jstests.jar">
<comment>
<embed
code="lc3.class"
codebase="../../../java"
archive="jstests.jar"
type="application/x-java-applet"
width=500
height=200>
<noembed>
No Java Support.
</noembed>
</comment>
</object>
<script>
function startTest()
{
window.applet = document.getElementsByTagName("embed")[0];
if (!applet.createQAObject)
window.applet = document.getElementsByTagName("object")[0];
debug(TITLE + "\n");
}
function shouldBeWithErrorCheck(_a, _b)
{
// Don't want full stack traces from Java exceptions.
if (window.layoutTestController) {
try {
eval(_a);
} catch (ex) {
if (/Caused by: /.test(ex)) {
testFailed(_a + ": Exception raised");
return;
}
}
}
var b_eval;
try {
b_eval = eval(_b);
} catch (ex) {
testFailed(_b + ": " + ex);
return;
}
if (b_eval == "error")
shouldThrow(_a);
else
shouldBe(_a, _b);
}
function wkTestStringToJavaByteArray(string)
{
return applet.stringToByteArray(string);
}
function appendScript(text)
{
var el = document.createElement("script")
el.appendChild = document.createTextNode(text);
document.body.appendChild(el);
}
function onload()
{
try {
var req = new XMLHttpRequest();
req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
if (req.overrideMimeType)
req.overrideMimeType("text/plain");
req.send();
if (!req.responseText.length)
throw "could not load test script";
var scriptElement = document.createElement("script")
scriptElement.appendChild(document.createTextNode(
req.responseText + "\n"));
document.body.appendChild(scriptElement);
} catch (ex) {
testFailed("Could not run test: " + ex);
}
scriptElement = document.createElement("script")
scriptElement.src = '../../../fast/js/resources/js-test-post-async.js'
document.body.appendChild(scriptElement);
}
</script>
</body>
</html>