Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!doctype html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test for Bug 854082</title> |
michael@0 | 5 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <script type="text/javascript" src="utils.js"></script> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 8 | |
michael@0 | 9 | <meta http-equiv="content-type" content="text/html; charset=utf-8"> |
michael@0 | 10 | <base href="chrome://browser/content/"> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <script type="application/javascript"> |
michael@0 | 14 | // Tests that destroying the plugin's frame inside NPP_New does not cause a |
michael@0 | 15 | // crash |
michael@0 | 16 | |
michael@0 | 17 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 18 | setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
michael@0 | 19 | |
michael@0 | 20 | // Create an object that will spawn asynchronously |
michael@0 | 21 | var o = document.createElement("object"); |
michael@0 | 22 | o.type = "application/x-test"; |
michael@0 | 23 | |
michael@0 | 24 | // The test plugin sets pluginFoundElement on its element inside NPP_New, |
michael@0 | 25 | // abuse this to run arbitrary script. |
michael@0 | 26 | var setterCalled; |
michael@0 | 27 | o.__defineSetter__("pluginFoundElement", function() { |
michael@0 | 28 | o.style.display = "none"; |
michael@0 | 29 | // Access clientTop to force layout flush |
michael@0 | 30 | o.clientTop; |
michael@0 | 31 | setterCalled = true; |
michael@0 | 32 | }); |
michael@0 | 33 | document.body.appendChild(o); |
michael@0 | 34 | |
michael@0 | 35 | SimpleTest.executeSoon(function() { |
michael@0 | 36 | ok(setterCalled, "Setter called and did not crash"); |
michael@0 | 37 | SimpleTest.finish(); |
michael@0 | 38 | }); |
michael@0 | 39 | </script> |
michael@0 | 40 | </body> |
michael@0 | 41 | </html> |