dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Outer.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <html>
     2 <body>
     4 <script>
     6 var numPrompts = 0;
     7 function handlePrompt(e) {
     8   numPrompts++;
    10   // The first two prompts should be "child1:ready" and "child2:ready".  Once
    11   // we get both of these, forward the child's prompt up to our parent.
    12   if (numPrompts == 2) {
    13     // This has to happen here, because setVisibile doesn't exist on the iframe
    14     // until BrowserElementChild.js is loaded in it.  (That's pretty broken...)
    15     iframe2.setVisible(false);
    16   }
    17   else if (numPrompts == 3) {
    18     if (e.detail.message != 'child2:hidden') {
    19       alert("parent:fail Didn't get expected 'child2:hidden'.");
    20     }
    22     alert('parent:ready');
    23   }
    24   else if (numPrompts == 4 || numPrompts == 5) {
    25     alert(e.detail.message);
    26   }
    27 }
    29 var iframe1 = document.createElement('iframe');
    30 iframe1.setAttribute("mozbrowser", "true");
    31 iframe1.addEventListener('mozbrowsershowmodalprompt', handlePrompt);
    33 var iframe2 = document.createElement('iframe');
    34 iframe2.setAttribute("mozbrowser", "true");
    35 iframe2.addEventListener('mozbrowsershowmodalprompt', handlePrompt);
    37 iframe1.src = 'file_browserElement_SetVisibleFrames_Inner.html?child1';
    38 iframe2.src = 'file_browserElement_SetVisibleFrames_Inner.html?child2';
    39 document.body.appendChild(iframe1);
    40 document.body.appendChild(iframe2);
    42 </script>
    44 </body>
    45 </html>

mercurial