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.

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

mercurial