Bug 899080 - Test fixup part 2 - dom/plugins. r=bsmedberg

This commit is contained in:
Georg Fritzsche 2013-09-04 16:05:40 +02:00
Родитель 613349b082
Коммит ce4d217ed2
85 изменённых файлов: 483 добавлений и 222 удалений

Просмотреть файл

@ -3,15 +3,15 @@
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
<body onload="start()">
<p id="display"></p>
<embed id="p" type="application/x-test" wmode="window"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function start() {
if (!SimpleTest.testPluginIsOOP()) {
@ -68,3 +68,5 @@
}, 2000);
}
</script>
<embed id="p" type="application/x-test" wmode="window"></embed>

Просмотреть файл

@ -2,12 +2,12 @@
<head>
<title>Test NPNVdocumentOrigin</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runTest()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTest() {
"use strict";
@ -39,5 +39,7 @@
SimpleTest.finish();
}
</script>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>
</html>

Просмотреть файл

@ -2,14 +2,14 @@
<head>
<title>Test NPPVpluginWantsAllNetworkStreams</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runNextTest()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var p = document.getElementById("plugin1");
var p = null;
var missingDoc = "not-found.html";
@ -65,6 +65,13 @@
SimpleTest.finish();
}
}
function runTests() {
p = document.getElementById("plugin1");
runNextTest();
}
</script>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>
</html>

Просмотреть файл

@ -8,12 +8,12 @@
<title>NPAPI Set Undefined Value Test</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="300" height="300"></embed>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement1 = document.getElementById("plugin1");
@ -32,4 +32,6 @@ function runTests() {
}
]]>
</script>
<embed id="plugin1" type="application/x-test" width="300" height="300"></embed>
</body>
</window>

Просмотреть файл

@ -4,13 +4,13 @@
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="setTimeout(runTests, 2000)">
<embed id="plugin1" type="application/x-test" width="400"
height="400" src="large-pic.jpg" functiontofail="npp_write_rpc" streammode="normal"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
try {
@ -23,3 +23,6 @@ function runTests() {
SimpleTest.finish();
}
</script>
<embed id="plugin1" type="application/x-test" width="400"
height="400" src="large-pic.jpg" functiontofail="npp_write_rpc" streammode="normal"></embed>

Просмотреть файл

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=539565
<title>Test #1 for Bug 539565</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script class="testbody" type="text/javascript">
@ -85,6 +86,7 @@ function runTests() {
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
</head>

Просмотреть файл

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=539565
<title>Test #2 for Bug 539565</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script class="testbody" type="text/javascript">
@ -105,6 +106,7 @@ function runTests() {
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
</head>

Просмотреть файл

@ -4,25 +4,11 @@
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript;version=1.7">
function getTestPlugin() {
let ph = Components.classes["@mozilla.org/plugin/host;1"]
.getService(Components.interfaces.nsIPluginHost);
let tags = ph.getPluginTags();
// Find the test plugin
for (let i = 0; i < tags.length; i++) {
if (tags[i].name == "Test Plug-in")
return tags[i];
}
ok(false, "Unable to find plugin");
return null;
}
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref("plugins.click_to_play", true);
let plugin = getTestPlugin();
plugin.enabledState = Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY;
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY);
</script>
</head>
@ -104,8 +90,6 @@
}
Services.prefs.clearUserPref("plugins.click_to_play");
let plugin = getTestPlugin();
plugin.enabledState = Components.interfaces.nsIPluginTag.STATE_ENABLED;
SimpleTest.finish();
}

Просмотреть файл

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=771202
<meta charset="utf-8">
<title>Test for Bug 771202</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
@ -16,6 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=771202
/** Test for recreating spliced plugin prototype chains after tranplant. **/
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function go() {
// Set things up.

Просмотреть файл

@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=777098
<meta charset="utf-8">
<title>Test for Bug 777098</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="go();">
@ -16,6 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=777098
/** Test for passing dead NPObjects back into plugins. **/
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function go() {
var plugin = document.getElementById('plugin');

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test for Bug 784131</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@ -10,10 +11,15 @@
</head>
<body>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<embed id="body" type="application/x-test">
<div>
<embed id="nested" type="application/x-test">
</div>
<script type="application/javascript">
function getObjectValue(obj) {
try {

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test for Bug 813906</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@ -16,17 +17,9 @@ function f() {
}
</script>
<svg>
<symbol id="a">
<foreignObject>
<object bugmode="813906" frame="frame1"></object>
</foreignObject>
</symbol>
<use />
</svg>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// When the document is torn down or <svg> is removed, we hit bug 621618
SimpleTest.expectAssertions(1);
@ -49,6 +42,15 @@ function frameLoaded() {
}
</script>
<svg>
<symbol id="a">
<foreignObject>
<object bugmode="813906" frame="frame1"></object>
</foreignObject>
</symbol>
<use />
</svg>
<iframe name="frame1" onload="frameLoaded()"></iframe>
</body>
</html>

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test for Bug 854082</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@ -14,6 +15,7 @@
// crash
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// Create an object that will spawn asynchronously
var o = document.createElement("object");

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test for Bug 863792</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@ -14,6 +15,7 @@
// inside NPP_New. We should not leak the instance. See also test_bug854082
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var i = document.createElement("iframe");
i.src = "file_bug863792.html";

Просмотреть файл

@ -10,6 +10,10 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="http://mochi.test:8888/chrome/dom/plugins/test/mochitest/hang_test.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -3,8 +3,13 @@
<title>NPAPI ClearSiteData/GetSitesWithData Functionality</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<script class="testbody" type="application/javascript">

Просмотреть файл

@ -2,11 +2,13 @@
<head>
<title>NPCocoaEventFocusChanged Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var gOtherWindow;

Просмотреть файл

@ -2,11 +2,13 @@
<head>
<title>NPCocoaEventWindowFocusChanged Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var gOtherWindow;

Просмотреть файл

@ -8,6 +8,10 @@
<title>NPN_ConvertPoint Tests</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -2,12 +2,14 @@
<head>
<title>NPAPI Cookie Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runTests()">
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement = document.getElementById("plugin1");
pluginElement.setCookie("foo");
@ -15,5 +17,7 @@
SimpleTest.finish();
}
</script>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
</body>
</html>

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test copying text from browser to plugin</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script class="testbody" type="text/javascript">
function runTests() {
@ -23,6 +24,7 @@ function runTests() {
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
</head>

Просмотреть файл

@ -1,10 +1,12 @@
<head>
<title>Plugin crashing in nested loop</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
window.frameLoaded = function frameLoaded_toCrash() {
if (!SimpleTest.testPluginIsOOP()) {

Просмотреть файл

@ -8,6 +8,10 @@
<title>Plugin Crash Notification Test</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -8,6 +8,10 @@
<title>Plugin Crash Notification Test</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -10,6 +10,10 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -1,10 +1,12 @@
<head>
<title>Plugin crashing</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
window.frameLoaded = function frameLoaded_toCrash() {
if (!SimpleTest.testPluginIsOOP()) {

Просмотреть файл

@ -1,12 +1,14 @@
<head>
<title>Plugin crashing</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="mainLoaded()">
<iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var iframe = document.getElementById('iframe1');

Просмотреть файл

@ -3,15 +3,15 @@
<title>NPObject [[DefaultValue]] implementation</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="run()">
<embed id="plugin" type="application/x-test" wmode="window"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function run() {
var plugin = document.getElementById("plugin");
@ -32,5 +32,7 @@
SimpleTest.finish();
}
</script>
<embed id="plugin" type="application/x-test" wmode="window"></embed>
</body>
</html>

Просмотреть файл

@ -2,17 +2,17 @@
<head>
<title>NPAPI Cookie Tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement = document.getElementById("plugin1");
var c = 0;
@ -28,5 +28,9 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
</body>
</html>

Просмотреть файл

@ -3,6 +3,7 @@
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css">
@ -11,6 +12,7 @@
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function frameLoaded() {
var testframe = document.getElementById('testframe');

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test for Login Manager</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
@ -58,6 +59,8 @@ function iframeLoad() {
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var iframe = document.getElementById("iframe");
var am = Cc["@mozilla.org/network/http-auth-manager;1"].
getService(Ci.nsIHttpAuthManager);

Просмотреть файл

@ -10,6 +10,10 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -1,10 +1,12 @@
<head>
<title>Plugin hanging</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
window.frameLoaded = function frameLoaded_toCrash() {
if (!SimpleTest.testPluginIsOOP()) {

Просмотреть файл

@ -10,6 +10,10 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="http://mochi.test:8888/chrome/dom/plugins/test/mochitest/hang_test.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
getTestPlugin().enabledState = Ci.nsIPluginTag.STATE_ENABLED;
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>

Просмотреть файл

@ -5,27 +5,17 @@
<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" />
<script type="text/javascript" src="utils.js"></script>
</head>
<body onload="begin()">
<p id="display"></p>
<div id="div1">
<!-- This embed has to have a "src" attribute. Part of this test involves seeing if we
properly restart plugins that have been added back to a document without a change
in URL. Not re-loading an object when the URL hasn't changed is a shortcut used for
some object types. Without a URL, this won't be tested. -->
<embed id="plugin1" src="loremipsum.txt" type="application/x-test" width="200" height="200"></embed>
</div>
<div id="div2">
</div>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
getTestPlugin().enabledState = SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED;
var exceptionThrown = false;
var p = document.getElementById('plugin1');
var d1 = document.getElementById('div1');
var d2 = document.getElementById('div2');
var p = null;
var d1 = null;
var d2 = null;
var destroyed = false;
@ -49,6 +39,10 @@
}
function runTests(callback) {
p = document.getElementById('plugin1');
d1 = document.getElementById('div1');
d2 = document.getElementById('div2');
// First tests involve moving the instance from one div to another.
p.startWatchingInstanceCount();
p.callOnDestroy(function() {
@ -96,5 +90,17 @@
});
}
</script>
<p id="display"></p>
<div id="div1">
<!-- This embed has to have a "src" attribute. Part of this test involves seeing if we
properly restart plugins that have been added back to a document without a change
in URL. Not re-loading an object when the URL hasn't changed is a shortcut used for
some object types. Without a URL, this won't be tested. -->
<embed id="plugin1" src="loremipsum.txt" type="application/x-test" width="200" height="200"></embed>
</div>
<div id="div2">
</div>
</body>
</html>

Просмотреть файл

@ -4,17 +4,13 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
<p id="display"></p>
<div id="div1">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var destroyed = false;
function onDestroy() {
@ -37,5 +33,11 @@
d1.removeChild(p1);
}
</script>
<p id="display"></p>
<div id="div1">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div>
</body>
</html>

Просмотреть файл

@ -4,23 +4,13 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
<p id="display"></p>
<div id="div1">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div>
<div id="div2">
<div id="div3">
<embed id="plugin2" type="application/x-test" width="200" height="200"></embed>
</div>
</div>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var destroyed = false;
function onDestroy() {
@ -46,5 +36,17 @@
d1.removeChild(p1);
}
</script>
<p id="display"></p>
<div id="div1">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div>
<div id="div2">
<div id="div3">
<embed id="plugin2" type="application/x-test" width="200" height="200"></embed>
</div>
</div>
</body>
</html>

Просмотреть файл

@ -4,19 +4,13 @@
<title>Test removing an instance's DOM node</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="startTest()">
<p id="display"></p>
<div id="div1">
<div id="div2">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div<
</div>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var destroyed = false;
function onDestroy() {
@ -40,5 +34,13 @@
d1.removeChild(d2);
}
</script>
<p id="display"></p>
<div id="div1">
<div id="div2">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</div<
</div>
</body>
</html>

Просмотреть файл

@ -1,12 +1,14 @@
<head>
<title>Plugin instantiation</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="mainLoaded()">
<iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var iframe = document.getElementById('iframe1');

Просмотреть файл

@ -1,13 +1,12 @@
<head>
<title>NPNV*NPObject accessibility tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="runTests()">
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<embed id="plugin2" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var p1 = document.getElementById('plugin1');
@ -20,3 +19,6 @@
SimpleTest.finish();
}
</script>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<embed id="plugin2" type="application/x-test" width="400" height="400"></embed>

Просмотреть файл

@ -1,17 +1,15 @@
<head>
<title>NPN_GetURL called from NPP_Destroy</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.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();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTest() {
var p = document.getElementById('plugin1');
@ -31,3 +29,7 @@
}, 1000);
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test"></embed>

Просмотреть файл

@ -3,19 +3,16 @@
<title>NPN_AsyncCallback Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function asyncTestsComplete(result) {
ok(result, "asyncCallback tests completed");
SimpleTest.finish();
@ -26,6 +23,11 @@
plugin.asyncCallbackTest("asyncTestsComplete");
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
</body>
</html>

Просмотреть файл

@ -3,19 +3,16 @@
<title>NPN_Timer Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function pluginTimerTestFinish(result) {
ok(result, "timer tests completed");
SimpleTest.finish();
@ -26,6 +23,11 @@
plugin.timerTest("pluginTimerTestFinish");
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
</body>
</html>

Просмотреть файл

@ -1,14 +1,14 @@
<head>
<title>NPNV*NPObject accessibility tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="runTests()">
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
dump('lastScript');
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
ok(document.getElementById('plugin1').pluginFoundElement, "plugin1.pluginFoundElement (NPNVPluginElementNPObject)", document.getElementById('plugin1').pluginFoundElement);
@ -17,3 +17,5 @@
SimpleTest.finish();
}
</script>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>

Просмотреть файл

@ -8,6 +8,10 @@
<title>Basic Plugin Tests</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
</body>

Просмотреть файл

@ -3,9 +3,14 @@
<head>
<title>Test whether windowless plugins receive correct visible/invisible notifications.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<p id="display"></p>
<embed id="theplugin" type="application/x-test"></embed>

Просмотреть файл

@ -3,6 +3,7 @@
<title>NPN_Invoke Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@ -15,6 +16,7 @@
// that identifiers are translated to values correctly.
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var testsRun = 0;

Просмотреть файл

@ -3,18 +3,15 @@
<title>NPN_Evaluate Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// global test function
function testMe(arg) {
@ -33,25 +30,26 @@
// members: the first is a string to eval, and the second is
// the expected result of the eval.
//
var tests = [
["3", 3],
["3 + 3", 6],
["'3'", "3"],
["function test() { return 3; } test();", 3],
["testMe(3)", 6],
["testMe(new Object(3))", 6],
["new Object(3)", new Object(3)],
["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
["document.getElementById('display')",
document.getElementById("display")],
["encodeURI('a = b')", "a%20=%20b"],
["document.getElementById('testdiv').innerHTML = 'Hello world!'",
"Hello world!"],
["function test2() { var x = {a: '1', b: '2'}; return x; } test2();",
{a: '1', b: '2'}],
];
function runTests() {
var tests = [
["3", 3],
["3 + 3", 6],
["'3'", "3"],
["function test() { return 3; } test();", 3],
["testMe(3)", 6],
["testMe(new Object(3))", 6],
["new Object(3)", new Object(3)],
["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
["document.getElementById('display')",
document.getElementById("display")],
["encodeURI('a = b')", "a%20=%20b"],
["document.getElementById('testdiv').innerHTML = 'Hello world!'",
"Hello world!"],
["function test2() { var x = {a: '1', b: '2'}; return x; } test2();",
{a: '1', b: '2'}],
];
var plugin = document.getElementById("plugin1");
// Test calling NPN_Evaluate from within plugin code.
@ -88,7 +86,12 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<div id="verbose">
</div>
<div id="testdiv">

Просмотреть файл

@ -3,14 +3,11 @@
<title>NPN_Invoke Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
////
@ -22,6 +19,7 @@
//
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// This function returns all the arguments passed to it, either as a
// single variable (in the caes of 1 argument), or as an array.
@ -152,7 +150,12 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<div id="verbose">
</div>
</body>

Просмотреть файл

@ -3,19 +3,16 @@
<title>NPN_Invoke_Default Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
// global test function
function testMe(arg) {
var result = arg+arg;
@ -144,7 +141,12 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<div id="verbose">
</div>
</body>

Просмотреть файл

@ -3,17 +3,14 @@
<title>NPN_SetException Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
// test a single exception thrown in scriptable invoke
@ -50,7 +47,12 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="400" height="100">
</embed>
<div id="verbose">
</div>
</body>

Просмотреть файл

@ -37,23 +37,11 @@
</style>
</head>
<body onload="initialize()">
<p id="display"></p>
<div id="container">
<embed id="paint-waiter" type="application/x-test"/>
<div id="clip">
<embed id="clipped" type="application/x-test"
drawmode="solid" color="FF808080"/>
</div>
</div>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var paint_waiter;
var clip;
@ -113,5 +101,20 @@ function waitForPaintHelper(func) {
}
</script>
<p id="display"></p>
<div id="container">
<embed id="paint-waiter" type="application/x-test"/>
<div id="clip">
<embed id="clipped" type="application/x-test"
drawmode="solid" color="FF808080"/>
</div>
</div>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

Просмотреть файл

@ -3,6 +3,10 @@
<head>
<title>Test that scrolling a windowless plugin doesn't force us to repaint it</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTest()">

Просмотреть файл

@ -5,30 +5,30 @@
<title>Test Modifying Plugin click-to-play Flag</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body>
<script class="testbody" type="application/javascript">
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref("plugins.click_to_play", true);
var pluginHost = Components.classes["@mozilla.org/plugin/host;1"]
.getService(Components.interfaces.nsIPluginHost);
is(pluginHost.getStateForType("application/x-test"), Components.interfaces.nsIPluginTag.STATE_ENABLED, "click-to-play should be off to begin with");
Services.prefs.setBoolPref("plugins.click_to_play", true);
var pluginTags = pluginHost.getPluginTags();
var testPlugin = null;
for (var plugin of pluginTags) {
if (plugin.name == "Test Plug-in") {
testPlugin = plugin;
break;
}
}
var testPlugin = getTestPlugin();
var secondTestPlugin = getTestPlugin("Second Test Plug-in");
ok(testPlugin, "Should have Test Plug-in");
testPlugin.enabledState = Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY;
is(pluginHost.getStateForType("application/x-test"), Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY, "click-to-play should be on for Test Plug-in now");
is(pluginHost.getStateForType("application/x-second-test"), Components.interfaces.nsIPluginTag.STATE_ENABLED, "click-to-play should still be off for the Second Test Plug-in");
ok(secondTestPlugin, "Should have Second Test Plug-in");
// make sure both start off as click-to-play
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY);
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Second Test Plug-in");
testPlugin.enabledState = Components.interfaces.nsIPluginTag.STATE_ENABLED;
is(pluginHost.getStateForType("application/x-test"), Components.interfaces.nsIPluginTag.STATE_ENABLED, "click-to-play should be off for Test Plug-in now");
is(pluginHost.getStateForType("application/x-second-test"), Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY, "click-to-play should still be on for the Second Test Plug-in");
testPlugin.enabledState = Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY;
is(pluginHost.getStateForType("application/x-test"), Components.interfaces.nsIPluginTag.STATE_CLICKTOPLAY, "click-to-play should be on for Test Plug-in now");
Services.prefs.clearUserPref("plugins.click_to_play");
</script>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -9,6 +9,7 @@ Tests for plugin stream error conditions.
<title>NPAPI Stream Error Tests</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@ -32,6 +33,7 @@ Tests for plugin stream error conditions.
function $(id) { return document.getElementById(id); }
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var tests = [

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -2,17 +2,14 @@
<title>Do plugin stream requests send the Referer header correctly?</title>
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<embed id="plugin2" type="application/x-test" src="loremipsum.xtest" width="200" height="200"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var pending = 3;
function testDone() {
@ -52,3 +49,7 @@
}
</script>
<p id="display"></p>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<embed id="plugin2" type="application/x-test" src="loremipsum.xtest" width="200" height="200"></embed>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -3,12 +3,14 @@
<title>NPAPI Seekable NPStream Test</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
<script>
SimpleTest.expectAssertions(0, 1);
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function frameLoaded() {
var testframe = document.getElementById('testframe');

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -5,6 +5,10 @@
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="pluginstream.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -2,6 +2,7 @@
<title>Do plugin stream src requests send the Referer header correctly?</title>
<script type="application/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
@ -10,6 +11,7 @@
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function frameLoaded() {
var testframe = document.getElementById('pluginframe');

Просмотреть файл

@ -3,6 +3,7 @@
<head>
<title>Test whether windowless plugins receive correct visible/invisible notifications.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<style type="text/css">
@ -14,14 +15,15 @@
<body onload="startTest()">
<p id="display"></p>
<embed id="theplugin" type="application/x-test" width="200" height="200"></embed>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var p = document.getElementById('theplugin');
var p = null;
function startTest() {
p = document.getElementById('theplugin');
// Wait for the plugin to have painted once
var interval = setInterval(function() {
if (!p.getPaintCount())
@ -50,3 +52,5 @@
SimpleTest.finish();
}
</script>
<embed id="theplugin" type="application/x-test" width="200" height="200"></embed>

Просмотреть файл

@ -10,6 +10,10 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/chrome-harness.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<embed id="plugin2" type="application/x-test" width="200" height="200"></embed>

Просмотреть файл

@ -3,13 +3,12 @@
<title>NPObject with property and method with the same name</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="run()">
<embed id="plugin" type="application/x-test" wmode="window"></embed>
<script class="testbody" type="application/javascript">
if (typeof Object.getPrototypeOf !== "function") {
if (typeof "test".__proto__ === "object") {
@ -25,6 +24,7 @@
}
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function run() {
var plugin = document.getElementById("plugin");
@ -45,5 +45,7 @@
SimpleTest.finish();
}
</script>
<embed id="plugin" type="application/x-test" wmode="window"></embed>
</body>
</html>

Просмотреть файл

@ -2,12 +2,14 @@
<head>
<title>NPAPI NPNVcontentsScaleFactor Test</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runTests()">
<embed id="plugin" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
function runTests() {
var pluginElement = document.getElementById("plugin");
var contentsScaleFactor;
@ -22,5 +24,7 @@
SimpleTest.finish();
}
</script>
<embed id="plugin" type="application/x-test" width="400" height="400"></embed>
</body>
</html>

Просмотреть файл

@ -2,14 +2,14 @@
<head>
<title>Basic NPAPI Redirect Handling</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body onload="runNextTest()">
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var p = document.getElementById("plugin1");
var p = null;
var redirectingURL = "307-xo-redirect.sjs";
var redirectTargetURL = "http://example.org/tests/dom/plugins/test/mochitest/loremipsum.txt";
@ -55,6 +55,13 @@
SimpleTest.finish();
}
}
function runTests() {
p = document.getElementById("plugin1");
runNextTest();
}
</script>
<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
</body>
</html>

Просмотреть файл

@ -6,10 +6,13 @@
<title>Test Refreshing navigator.plugins (bug 820708)</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
<script type="application/javascript" src="utils.js"></script>
</head>
<body>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var pluginHost = Components.classes["@mozilla.org/plugin/host;1"]
.getService(Components.interfaces.nsIPluginHost);
var pluginTags = pluginHost.getPluginTags();

Просмотреть файл

@ -3,14 +3,15 @@
<title>Second Test Plug-in Test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="run()">
<object id="plugin" type="application/x-second-test" width=200 height=200></object>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
function run() {
var foundFirstPlugin = false;
@ -29,5 +30,7 @@
SimpleTest.finish();
}
</script>
<object id="plugin" type="application/x-second-test" width=200 height=200></object>
</body>
</html>

Просмотреть файл

@ -4,17 +4,13 @@
<title>Test changing src attribute</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTests()">
<p id="display"></p>
<embed id="plugin1" src="about:blank" type="application/x-test" width="200" height="200"></embed>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
var p = document.getElementById('plugin1');
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var destroyed = false;
function onDestroy() {
@ -22,6 +18,8 @@
}
function runTests() {
p = document.getElementById('plugin1');
p.startWatchingInstanceCount();
p.callOnDestroy(onDestroy);
@ -35,6 +33,10 @@
SimpleTest.finish();
}
</script>
<p id="display"></p>
<embed id="plugin1" src="about:blank" type="application/x-test" width="200" height="200"></embed>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<head>
<title>NPN_Get/PostURLNotify tests</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="utils.js"></script>
<body onload="runTests()">
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var pending = 5;
function testDone() {
@ -84,3 +84,5 @@
}, null, true), "streamTest GET bad data: URI");
}
</script>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>

Просмотреть файл

@ -3,23 +3,21 @@
<title>Stream open at NPP_Destroy</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.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();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var urlnotified = false;
var p = document.getElementById('embedtest');
var p = null;
function startTest() {
p = document.getElementById('embedtest');
ok(p.streamTest("neverending.sjs", false, null, null,
function(r, t) {
is(r, 2, "Stream should have failed");
@ -40,3 +38,8 @@
}
</script>
<p id="display"></p>
<embed id="embedtest"
style="width: 400px; height: 100px;" type="application/x-test"></embed>

Просмотреть файл

@ -3,6 +3,7 @@
<title>Dual NPAPI NP_ASFILEONLY NPStream Test</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
@ -13,6 +14,7 @@
SimpleTest.expectAssertions(0, 2);
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var framesToLoad = 2;
function frameLoaded(id) {

Просмотреть файл

@ -15,6 +15,7 @@
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var didPaint = function() {};

Просмотреть файл

@ -3,21 +3,17 @@
<title>Test NPN_Invalidate working for a windowed plugin</title>
<script type="text/javascript"
src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css"
href="/tests/SimpleTest/test.css" />
</head>
<body onload="checkPaintCountStabilized()">
<p id="display"></p>
<embed id="p" type="application/x-test" wmode="window" drawmode="solid"
color="FFFF0000">
</embed>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var lastPaintCount;
var p = document.getElementById("p");
var p = null;
function checkPainted() {
if (p.getPaintCount() > lastPaintCount) {
@ -50,8 +46,19 @@
}
}, 1000);
}
function runTests() {
p = document.getElementById("p");
checkPaintCountStabilized();
}
</script>
<p id="display"></p>
<embed id="p" type="application/x-test" wmode="window" drawmode="solid"
color="FFFF0000">
</embed>
<div id="verbose">
</div>
</body>

Просмотреть файл

@ -8,6 +8,10 @@
<title>WMode Tests</title>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script type="application/javascript">
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
</script>
<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
<embed id="plugin2" type="application/x-test" width="400" height="400" wmode="window"></embed>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>

Просмотреть файл

@ -5,9 +5,11 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript" src="utils.js"></script>
<script>
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var w = window.open('xulbrowser_plugin_visibility.xul', '_blank', 'chrome,resizable=yes,width=400,height=600');

Просмотреть файл

@ -3,19 +3,18 @@
<head>
<title>Test whether windowed plugins with opacity:0 get their window set correctly</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body onload="startTest()">
<p id="display"></p>
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>
<script type="application/javascript;version=1.8">
SimpleTest.waitForExplicitFinish();
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
var p = document.getElementById('theplugin');
var p = null;
function startTest() {
p = document.getElementById('theplugin');
if (!p.hasWidget()) {
todo(false, "This test is only relevant for windowed plugins");
SimpleTest.finish();
@ -39,3 +38,7 @@
is(p.getClipRegionRectEdge(0,3) - p.getClipRegionRectEdge(0,1), 50, "height of clip region rect");
}
</script>
<p id="display"></p>
<embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>

Просмотреть файл

@ -15,3 +15,30 @@ function paintCountIs(plugin, expected, msg) {
" independent paints, expected " + realExpected + " logged paints, got " +
count + " actual paints)");
}
function getTestPlugin(pluginName) {
var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
.getService(SpecialPowers.Ci.nsIPluginHost);
var tags = ph.getPluginTags();
var name = pluginName || "Test Plug-in";
for (var tag of tags) {
if (tag.name == name) {
return tag;
}
}
ok(false, "Could not find plugin tag with plugin name '" + name + "'");
return null;
}
// call this to set the test plugin(s) initially expected enabled state.
// it will automatically be reset to it's previous value after the test
// ends
function setTestPluginEnabledState(newEnabledState, pluginName) {
var plugin = getTestPlugin(pluginName);
var oldEnabledState = plugin.enabledState;
plugin.enabledState = newEnabledState;
SimpleTest.registerCleanupFunction(function() {
getTestPlugin(pluginName).enabledState = oldEnabledState;
});
}