Bug 1151111 - Append iframe2 after iframe1 has loaded. r=kchen
authorMorris Tseng <mtseng@mozilla.com>
Tue, 05 May 2015 19:42:00 -0400
changeset 272447 0376b1ce88bc249e043e2bd730e3991290c298e9
parent 272446 230adc57e016d687dcd5b0899ed16c5d6c78638f
child 272448 7bd4220e26aeea627d11b3f2eb8690c1f6e45f01
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskchen
bugs1151111
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1151111 - Append iframe2 after iframe1 has loaded. r=kchen
dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
--- a/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
+++ b/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
@@ -14,30 +14,30 @@
 
 var frame_src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs';
 
 var iframe1 = document.createElement('iframe');
 iframe1.height = '300px';
 var iframe2 = document.createElement('iframe');
 iframe2.height = '300px';
 document.body.appendChild(iframe1);
-document.body.appendChild(iframe2);
 
 iframe1.addEventListener('load', function iframe1Load() {
   iframe1.removeEventListener('load', iframe1Load);
   // This causes our embedder to take a screenshot (and blocks until the
   // screenshot is completed).
   var iframe2Loaded = false;
   iframe2.addEventListener('load', function iframe2Load() {
     iframe2.removeEventListener('load', iframe2Load);
     iframe2Loaded = true;
     alert('finish');
   });
 
-  setTimeout(function() { iframe2.src = frame_src; }, 1000);
+  document.body.appendChild(iframe2);
+  iframe2.src = frame_src;
 });
 
 
 iframe1.src = frame_src + '?iframe1';
 </script>
 
 </body>
 </html>