dom/plugins/test/mochitest/test_bug771202.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/test/mochitest/test_bug771202.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=771202
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 771202</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <script type="application/javascript" src="utils.js"></script>
    1.14 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.15 +</head>
    1.16 +<body>
    1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=771202">Mozilla Bug 771202</a>
    1.18 +<pre id="test">
    1.19 +<script type="application/javascript">
    1.20 +
    1.21 +/** Test for recreating spliced plugin prototype chains after tranplant. **/
    1.22 +SimpleTest.waitForExplicitFinish();
    1.23 +setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    1.24 +
    1.25 +function go() {
    1.26 +  // Set things up.
    1.27 +  var win = document.getElementById('ifr').contentWindow;
    1.28 +  var plugin = win.document.getElementById('pluginElement');
    1.29 +  var testValue = plugin.getObjectValue();
    1.30 +
    1.31 +  function checkPlugin() {
    1.32 +      dump("About to call checkObjectValue\n");
    1.33 +      ok(plugin.checkObjectValue(testValue), 'Plugin proto should work correctly');
    1.34 +  }
    1.35 +  // First, check things before transplanting.
    1.36 +  checkPlugin();
    1.37 +
    1.38 +  // Adopt the plugin and retest.
    1.39 +  document.body.appendChild(plugin);
    1.40 +  checkPlugin();
    1.41 +
    1.42 +  // All done.
    1.43 +  SimpleTest.finish();
    1.44 +}
    1.45 +
    1.46 +</script>
    1.47 +</pre>
    1.48 +
    1.49 +<iframe id="ifr" onload="go();" src="file_bug771202.html">
    1.50 +</body>
    1.51 +</html>

mercurial