Bug 854082 - Test. r=bsmedberg
authorJohn Schoenick <jschoenick@mozilla.com>
Tue, 26 Mar 2013 17:14:27 -0700
changeset 129669 8f1599c9c715511d198e45bdc8272fbf5f823716
parent 129668 e03057b8c8ca2ae635e99e1dc39cab174e63ca06
child 129670 2db093c411a51fdc08342b10bb4804c9cc550e06
push id26946
push userjschoenick@mozilla.com
push dateTue, 23 Apr 2013 20:22:19 +0000
treeherdermozilla-inbound@39b0b62b8cd2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs854082
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 854082 - Test. r=bsmedberg
dom/plugins/test/mochitest/Makefile.in
dom/plugins/test/mochitest/test_bug854082.html
--- a/dom/plugins/test/mochitest/Makefile.in
+++ b/dom/plugins/test/mochitest/Makefile.in
@@ -62,16 +62,17 @@ MOCHITEST_FILES = \
   test_bug539565-1.html \
   test_bug539565-2.html \
   test_bug771202.html \
   file_bug771202.html \
   test_bug777098.html \
   test_bug751809.html \
   test_bug813906.html \
   test_bug784131.html \
+  test_bug854082.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/test_bug854082.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+<head>
+  <title>Test for Bug 854082</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+
+  <meta http-equiv="content-type" content="text/html; charset=utf-8">
+  <base href="chrome://browser/content/">
+</head>
+<body>
+<script type="application/javascript">
+  // Tests that destroying the plugin's frame inside NPP_New does not cause a
+  // crash
+
+  SimpleTest.waitForExplicitFinish();
+
+  // Create an object that will spawn asynchronously
+  var o = document.createElement("object");
+  o.type = "application/x-test";
+
+  // The test plugin sets pluginFoundElement on its element inside NPP_New,
+  // abuse this to run arbitrary script.
+  var setterCalled;
+  o.__defineSetter__("pluginFoundElement", function() {
+    o.style.display = "none";
+    // Access clientTop to force layout flush
+    o.clientTop;
+    setterCalled = true;
+  });
+  document.body.appendChild(o);
+
+  SimpleTest.executeSoon(function() {
+    ok(setterCalled, "Setter called and did not crash");
+    SimpleTest.finish();
+  });
+</script>
+</body>
+</html>