1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/test/mochitest/test_src_url_change.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test changing src attribute</title> 1.8 + <script type="text/javascript" src="/MochiKit/packed.js"></script> 1.9 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.10 + <script type="text/javascript" src="utils.js"></script> 1.11 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.12 +</head> 1.13 +<body onload="runTests()"> 1.14 + <script type="application/javascript;version=1.8"> 1.15 + SimpleTest.waitForExplicitFinish(); 1.16 + setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); 1.17 + 1.18 + var destroyed = false; 1.19 + function onDestroy() { 1.20 + destroyed = true; 1.21 + } 1.22 + 1.23 + function runTests() { 1.24 + p = document.getElementById('plugin1'); 1.25 + 1.26 + p.startWatchingInstanceCount(); 1.27 + p.callOnDestroy(onDestroy); 1.28 + 1.29 + p.setAttribute("src", "loremipsum.txt"); 1.30 + 1.31 + is(destroyed, true, "Instance should have been destroyed."); 1.32 + is(p.getInstanceCount(), 1, "One new instance should have been created."); 1.33 + 1.34 + p.stopWatchingInstanceCount(); 1.35 + 1.36 + SimpleTest.finish(); 1.37 + } 1.38 + </script> 1.39 + 1.40 + <p id="display"></p> 1.41 + 1.42 + <embed id="plugin1" src="about:blank" type="application/x-test" width="200" height="200"></embed> 1.43 +</body> 1.44 +</html> 1.45 +