1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/test/mochitest/test_enumerate.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +<html> 1.5 +<head> 1.6 + <title>NPAPI Cookie Tests</title> 1.7 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.8 + <script type="application/javascript" src="utils.js"></script> 1.9 + 1.10 + <link rel="stylesheet" type="text/css" 1.11 + href="/tests/SimpleTest/test.css" /> 1.12 +</head> 1.13 + 1.14 +<body onload="runTests()"> 1.15 + <script class="testbody" type="application/javascript"> 1.16 + SimpleTest.waitForExplicitFinish(); 1.17 + setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); 1.18 + 1.19 + function runTests() { 1.20 + var pluginElement = document.getElementById("plugin1"); 1.21 + var c = 0; 1.22 + var foundSetColor = false; 1.23 + for (var n in pluginElement) { 1.24 + ++c; 1.25 + ok(n in pluginElement, "Enumerated property which doesn't exist?"); 1.26 + if (n == 'setColor') 1.27 + foundSetColor = true; 1.28 + } 1.29 + ok(c > 0, "Should have enumerated some properties"); 1.30 + ok(foundSetColor, "Should have enumerated .setColor"); 1.31 + SimpleTest.finish(); 1.32 + } 1.33 + </script> 1.34 + 1.35 + <p id="display"></p> 1.36 + 1.37 + <embed id="plugin1" type="application/x-test" width="400" height="400"></embed> 1.38 +</body> 1.39 +</html>