dom/plugins/test/mochitest/test_src_url_change.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   <title>Test changing src attribute</title>
     5   <script type="text/javascript" src="/MochiKit/packed.js"></script>
     6   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     7   <script type="text/javascript" src="utils.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     9 </head>
    10 <body onload="runTests()">
    11   <script type="application/javascript;version=1.8">
    12   SimpleTest.waitForExplicitFinish();
    13   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    15   var destroyed = false;
    16   function onDestroy() {
    17     destroyed = true;
    18   }
    20   function runTests() {
    21     p = document.getElementById('plugin1');
    23     p.startWatchingInstanceCount();
    24     p.callOnDestroy(onDestroy);
    26     p.setAttribute("src", "loremipsum.txt");
    28     is(destroyed, true, "Instance should have been destroyed.");
    29     is(p.getInstanceCount(), 1, "One new instance should have been created.");
    31     p.stopWatchingInstanceCount();
    33     SimpleTest.finish();
    34   }
    35   </script>
    37   <p id="display"></p>
    39   <embed id="plugin1" src="about:blank" type="application/x-test" width="200" height="200"></embed>
    40 </body>
    41 </html>

mercurial