Wed, 31 Dec 2014 06:09:35 +0100
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 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=655682 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 655682</title> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 10 | </head> |
michael@0 | 11 | <body> |
michael@0 | 12 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=655682">Mozilla Bug 655682</a> |
michael@0 | 13 | <p id="display"></p> |
michael@0 | 14 | <div id="content" style="display: none"> |
michael@0 | 15 | <iframe src=file_bug655682.sjs></iframe> |
michael@0 | 16 | </div> |
michael@0 | 17 | <pre id="test"> |
michael@0 | 18 | <script type="application/javascript"> |
michael@0 | 19 | |
michael@0 | 20 | /** Test for Bug 655682 **/ |
michael@0 | 21 | |
michael@0 | 22 | var gotOnload = false; |
michael@0 | 23 | var finishedTesting = false; |
michael@0 | 24 | |
michael@0 | 25 | function tryFinishTest() { |
michael@0 | 26 | if (gotOnload && finishedTesting) { |
michael@0 | 27 | SimpleTest.finish(); |
michael@0 | 28 | } |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | addLoadEvent(function() { |
michael@0 | 32 | // Hit the event loop again just to make sure that we're not ending the test |
michael@0 | 33 | // before all activity we care about is done. |
michael@0 | 34 | SimpleTest.executeSoon(function() { |
michael@0 | 35 | gotOnload = true; |
michael@0 | 36 | tryFinishTest(); |
michael@0 | 37 | }); |
michael@0 | 38 | }); |
michael@0 | 39 | |
michael@0 | 40 | var tdsSeen = 0; |
michael@0 | 41 | |
michael@0 | 42 | var triggeredSecondTd = false; |
michael@0 | 43 | |
michael@0 | 44 | var iframe = document.getElementsByTagName("iframe")[0]; |
michael@0 | 45 | |
michael@0 | 46 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 47 | |
michael@0 | 48 | function probe() { |
michael@0 | 49 | var tds = iframe.contentDocument.getElementsByTagName("td").length; |
michael@0 | 50 | switch (tds) { |
michael@0 | 51 | case 0: |
michael@0 | 52 | setTimeout(probe, 0); |
michael@0 | 53 | return; |
michael@0 | 54 | case 1: |
michael@0 | 55 | tdsSeen = tds; |
michael@0 | 56 | if (!triggeredSecondTd) { |
michael@0 | 57 | triggeredSecondTd = true; |
michael@0 | 58 | var script = document.createElement("script"); |
michael@0 | 59 | script.src = "file_bug655682.sjs?trigger=1"; |
michael@0 | 60 | document.head.appendChild(script); |
michael@0 | 61 | } |
michael@0 | 62 | setTimeout(probe, 0); |
michael@0 | 63 | return; |
michael@0 | 64 | case 2: |
michael@0 | 65 | is(tdsSeen, 1, "Should have seen one td before seeing two."); |
michael@0 | 66 | finishedTesting = true; |
michael@0 | 67 | tryFinishTest(); |
michael@0 | 68 | return; |
michael@0 | 69 | default: |
michael@0 | 70 | ok(false, "Wrong number of tds"); |
michael@0 | 71 | SimpleTest.finish(); |
michael@0 | 72 | } |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | setTimeout(probe, 0); |
michael@0 | 76 | |
michael@0 | 77 | </script> |
michael@0 | 78 | </pre> |
michael@0 | 79 | </body> |
michael@0 | 80 | </html> |