testing/mochitest/chrome/test_sanityPluginUtils.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <script type="text/javascript">
     5   var start = new Date();
     6   </script>
     7   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"></script>
     8   <script type="text/javascript">
     9   var loadTime = new Date();
    10   </script>
    11   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    12   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    13 </head>
    14 <body onload="starttest()">
    15 <!-- load the test plugin defined at $(DIST)/bin/plugins/Test.plugin/ -->
    16 <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
    17 <script class="testbody" type="text/javascript">
    18 info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n");
    19 function starttest() {
    20   SimpleTest.waitForExplicitFinish();
    21   var startTime = new Date();
    22   //increase the runtime of the test so it is detectible, otherwise we get 0-1ms
    23   runtimes = 100;
    24   function runTest(plugin) {
    25     is(plugin.version, "1.0.0.0", "Make sure version is correct");
    26     is(plugin.name, "Test Plug-in");
    27   };
    28   while (runtimes > 0) {
    29     ok(PluginUtils.withTestPlugin(runTest), "Test plugin should be found");
    30     --runtimes;
    31   }
    32   var endTime = new Date();
    33   info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n");
    34   SimpleTest.finish();
    35 };
    36 </script>
    37 </body>
    38 </html>

mercurial