Bug 1151111 - Append iframe2 after iframe1 has loaded. r=kchen, a=test-only
authorMorris Tseng <mtseng@mozilla.com>
Tue, 05 May 2015 19:42:00 -0400
changeset 260410 e4e557754405
parent 260409 010ace914d50
child 260411 db14fef19c05
push id775
push userryanvm@gmail.com
push date2015-05-07 00:07 +0000
treeherdermozilla-release@46b968653f4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskchen, test-only
bugs1151111
milestone38.0
Bug 1151111 - Append iframe2 after iframe1 has loaded. r=kchen, a=test-only
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>