1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +<html> 1.5 +<body> 1.6 + 1.7 +<script> 1.8 + 1.9 +var numPrompts = 0; 1.10 +function handlePrompt(e) { 1.11 + numPrompts++; 1.12 + 1.13 + // The first two prompts should be "child1:ready" and "child2:ready". Once 1.14 + // we get both of these, forward the child's prompt up to our parent. 1.15 + if (numPrompts == 2) { 1.16 + // This has to happen here, because setVisibile doesn't exist on the iframe 1.17 + // until BrowserElementChild.js is loaded in it. (That's pretty broken...) 1.18 + iframe2.setVisible(false); 1.19 + } 1.20 + else if (numPrompts == 3) { 1.21 + if (e.detail.message != 'child2:hidden') { 1.22 + alert("parent:fail Didn't get expected 'child2:hidden'."); 1.23 + } 1.24 + 1.25 + alert('parent:ready'); 1.26 + } 1.27 + else if (numPrompts == 4 || numPrompts == 5) { 1.28 + alert(e.detail.message); 1.29 + } 1.30 +} 1.31 + 1.32 +var iframe1 = document.createElement('iframe'); 1.33 +iframe1.setAttribute("mozbrowser", "true"); 1.34 +iframe1.addEventListener('mozbrowsershowmodalprompt', handlePrompt); 1.35 + 1.36 +var iframe2 = document.createElement('iframe'); 1.37 +iframe2.setAttribute("mozbrowser", "true"); 1.38 +iframe2.addEventListener('mozbrowsershowmodalprompt', handlePrompt); 1.39 + 1.40 +iframe1.src = 'file_browserElement_SetVisibleFrames_Inner.html?child1'; 1.41 +iframe2.src = 'file_browserElement_SetVisibleFrames_Inner.html?child2'; 1.42 +document.body.appendChild(iframe1); 1.43 +document.body.appendChild(iframe2); 1.44 + 1.45 +</script> 1.46 + 1.47 +</body> 1.48 +</html>