Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | Test that calling setVisible('false') on an iframe causes its visibility to |
michael@0 | 5 | change. |
michael@0 | 6 | --> |
michael@0 | 7 | <head> |
michael@0 | 8 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="../browserElementTestHelpers.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | |
michael@0 | 14 | <script type="application/javascript;version=1.7"> |
michael@0 | 15 | "use strict"; |
michael@0 | 16 | |
michael@0 | 17 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 18 | browserElementTestHelpers.setEnabledPref(true); |
michael@0 | 19 | browserElementTestHelpers.addPermission(); |
michael@0 | 20 | browserElementTestHelpers.enableProcessPriorityManager(); |
michael@0 | 21 | |
michael@0 | 22 | function runTest() { |
michael@0 | 23 | var iframe = document.createElement('iframe'); |
michael@0 | 24 | iframe.setAttribute('mozbrowser', true); |
michael@0 | 25 | |
michael@0 | 26 | iframe.src = browserElementTestHelpers.emptyPage1; |
michael@0 | 27 | |
michael@0 | 28 | var childID = null; |
michael@0 | 29 | expectOnlyOneProcessCreated().then(function(chid) { |
michael@0 | 30 | childID = chid; |
michael@0 | 31 | }).then(function() { |
michael@0 | 32 | return expectPriorityChange(childID, 'FOREGROUND'); |
michael@0 | 33 | }).then(function() { |
michael@0 | 34 | return expectMozbrowserEvent(iframe, 'loadend'); |
michael@0 | 35 | }).then(function() { |
michael@0 | 36 | var p = expectPriorityChange(childID, 'BACKGROUND'); |
michael@0 | 37 | |
michael@0 | 38 | // We wait until mozbrowserloadend before calling setVisible, because |
michael@0 | 39 | // setVisible isn't available until mozbrowser has loaded. In practice, that |
michael@0 | 40 | // means we can call setVisible once we've gotten /any/ mozbrowser event. |
michael@0 | 41 | iframe.setVisible(false); |
michael@0 | 42 | return p; |
michael@0 | 43 | }).then(function() { |
michael@0 | 44 | var p = expectPriorityChange(childID, 'FOREGROUND'); |
michael@0 | 45 | iframe.setVisible(true); |
michael@0 | 46 | }).then(SimpleTest.finish); |
michael@0 | 47 | |
michael@0 | 48 | document.body.appendChild(iframe); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | addEventListener('testready', runTest); |
michael@0 | 52 | |
michael@0 | 53 | </script> |
michael@0 | 54 | </body> |
michael@0 | 55 | </html> |