testing/mochitest/chrome/test_sanityPluginUtils.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mochitest/chrome/test_sanityPluginUtils.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <script type="text/javascript">
     1.8 +  var start = new Date();
     1.9 +  </script>
    1.10 +  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
    1.11 +  <script type="text/javascript">
    1.12 +  var loadTime = new Date();
    1.13 +  </script>
    1.14 +  <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.15 +  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.16 +</head>
    1.17 +<body onload="starttest()">
    1.18 +<!-- load the test plugin defined at $(DIST)/bin/plugins/Test.plugin/ -->
    1.19 +<embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
    1.20 +<script class="testbody" type="text/javascript">
    1.21 +info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n");
    1.22 +function starttest() {
    1.23 +  SimpleTest.waitForExplicitFinish();
    1.24 +  var startTime = new Date();
    1.25 +  //increase the runtime of the test so it is detectible, otherwise we get 0-1ms
    1.26 +  runtimes = 100;
    1.27 +  function runTest(plugin) {
    1.28 +    is(plugin.version, "1.0.0.0", "Make sure version is correct");
    1.29 +    is(plugin.name, "Test Plug-in");
    1.30 +  };
    1.31 +  while (runtimes > 0) {
    1.32 +    ok(PluginUtils.withTestPlugin(runTest), "Test plugin should be found");
    1.33 +    --runtimes;
    1.34 +  }
    1.35 +  var endTime = new Date();
    1.36 +  info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n");
    1.37 +  SimpleTest.finish();
    1.38 +};
    1.39 +</script>
    1.40 +</body>
    1.41 +</html>

mercurial