testing/mochitest/chrome/test_sanityPluginUtils.html

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:2941557f9757
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