Bug 475991 - Extend the NPAPI to allow plugins to participate in redirects - fix line endings; r=rcampbell, a=test-fix; DONTBUILD

This commit is contained in:
Rob Campbell 2010-12-23 12:30:44 -04:00
parent cb40fc1d90
commit f22fbb6193
2 changed files with 78 additions and 78 deletions

View File

@ -1,34 +1,34 @@
<head>
<title>NPN_GetURL called from NPP_Destroy</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
<body onload="runTest()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
function runTest() {
var p = document.getElementById('plugin1');
var destroyed = false;
p.callOnDestroy(function() {
destroyed = true;
ok(!p.streamTest('loremipsum.txt', false, null,
function(r, t) {
ok(false, "get-during-destroy should have failed");
}), "NPN_GetURLNotify should fail during NPP_Destroy");
});
document.body.removeChild(p);
setTimeout(function() {
ok(destroyed, "callback was fired as expected");
SimpleTest.finish();
}, 1000);
}
</script>
<head>
<title>NPN_GetURL called from NPP_Destroy</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
<body onload="runTest()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
function runTest() {
var p = document.getElementById('plugin1');
var destroyed = false;
p.callOnDestroy(function() {
destroyed = true;
ok(!p.streamTest('loremipsum.txt', false, null,
function(r, t) {
ok(false, "get-during-destroy should have failed");
}), "NPN_GetURLNotify should fail during NPP_Destroy");
});
document.body.removeChild(p);
setTimeout(function() {
ok(destroyed, "callback was fired as expected");
SimpleTest.finish();
}, 1000);
}
</script>

View File

@ -1,44 +1,44 @@
<html>
<head>
<title>Stream open at NPP_Destroy</title>
<script type="text/javascript"
src="/MochiKit/packed.js"></script>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
<body onload="startTest()">
<p id="display"></p>
<embed id="embedtest"
style="width: 400px; height: 100px;" type="application/x-test"></embed>
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
var urlnotified = false;
var p = document.getElementById('embedtest');
function startTest() {
ok(p.streamTest("neverending.sjs", false, null,
function(r, t) {
is(r, 2, "Stream should have failed");
urlnotified = true;
}), "neverending.sjs started successfully");
setTimeout(removePlugin, 500);
}
function removePlugin() {
document.body.removeChild(p); // Fires NPP_Destroy immediately
SimpleTest.executeSoon(done);
}
function done() {
ok(urlnotified, "NPP_URLNotify should be called if streams are active at NPP_Destroy");
SimpleTest.finish();
}
</script>
<html>
<head>
<title>Stream open at NPP_Destroy</title>
<script type="text/javascript"
src="/MochiKit/packed.js"></script>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
<body onload="startTest()">
<p id="display"></p>
<embed id="embedtest"
style="width: 400px; height: 100px;" type="application/x-test"></embed>
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
var urlnotified = false;
var p = document.getElementById('embedtest');
function startTest() {
ok(p.streamTest("neverending.sjs", false, null,
function(r, t) {
is(r, 2, "Stream should have failed");
urlnotified = true;
}), "neverending.sjs started successfully");
setTimeout(removePlugin, 500);
}
function removePlugin() {
document.body.removeChild(p); // Fires NPP_Destroy immediately
SimpleTest.executeSoon(done);
}
function done() {
ok(urlnotified, "NPP_URLNotify should be called if streams are active at NPP_Destroy");
SimpleTest.finish();
}
</script>