Bug 771202 - Tests. r=bsmedberg
authorBobby Holley <bobbyholley@gmail.com>
Fri, 13 Jul 2012 13:20:08 +0200
changeset 101896 9f4294d7f12e3f3f53c2650957fcca695a2b0831
parent 101895 6c7c4782f088dfa7ab895d5cb04acdbb80b7d3ec
child 101897 369c2e5757eab01fa8508a3866600eea75fb7e77
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs771202
milestone16.0a1
Bug 771202 - Tests. r=bsmedberg
dom/plugins/test/mochitest/Makefile.in
dom/plugins/test/mochitest/file_bug771202.html
dom/plugins/test/mochitest/test_bug771202.html
--- a/dom/plugins/test/mochitest/Makefile.in
+++ b/dom/plugins/test/mochitest/Makefile.in
@@ -59,16 +59,18 @@ MOCHITEST_FILES = \
   test_crashing.html \
   $(warning test_crashing2.html disabled due to random orange; see bug 566049) \
   test_hanging.html \
   crashing_subpage.html \
   test_GCrace.html \
   test_propertyAndMethod.html \
   test_bug539565-1.html \
   test_bug539565-2.html \
+  test_bug771202.html \
+  file_bug771202.html \
   test_enumerate.html \
   test_npruntime_construct.html \
   307-xo-redirect.sjs \
   test_redirect_handling.html \
   test_zero_opacity.html \
   test_NPPVpluginWantsAllNetworkStreams.html \
   test_npruntime_npnsetexception.html \
   test_NPNVdocumentOrigin.html \
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/file_bug771202.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+  <embed id="pluginElement" type="application/x-test" width="200" height="200"></embed>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_bug771202.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=771202
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 771202</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=771202">Mozilla Bug 771202</a>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for recreating spliced plugin prototype chains after tranplant. **/
+SimpleTest.waitForExplicitFinish();
+
+function go() {
+  // Set things up.
+  var win = document.getElementById('ifr').contentWindow;
+  var plugin = win.document.getElementById('pluginElement');
+  var testValue = plugin.getObjectValue();
+
+  function checkPlugin() {
+      dump("About to call checkObjectValue\n");
+      ok(plugin.checkObjectValue(testValue), 'Plugin proto should work correctly');
+  }
+  // First, check things before transplanting.
+  checkPlugin();
+
+  // Adopt the plugin and retest.
+  document.body.appendChild(plugin);
+  checkPlugin();
+
+  // All done.
+  SimpleTest.finish();
+}
+
+</script>
+</pre>
+
+<iframe id="ifr" onload="go();" src="file_bug771202.html">
+</body>
+</html>