Bug 873661 - Wait both browserloadend and process-created event. r=fabrice, a=test-only
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Wed, 19 Feb 2014 10:55:25 +0800
changeset 157044 2ea6a65eea231354cf77e6cfb508e67cd6ab6543
parent 157043 28ab1d8df3453afbc2ba8373908cc1dad2e652ba
child 157045 d809af26b2786ce190953ff1396173ab1dc6a155
push id454
push userryanvm@gmail.com
push dateWed, 19 Feb 2014 17:08:17 +0000
reviewersfabrice, test-only
bugs873661
milestone26.0
Bug 873661 - Wait both browserloadend and process-created event. r=fabrice, a=test-only
dom/browser-element/mochitest/priority/test_NestedFrames.html
--- a/dom/browser-element/mochitest/priority/test_NestedFrames.html
+++ b/dom/browser-element/mochitest/priority/test_NestedFrames.html
@@ -44,23 +44,23 @@ function runTest() {
   var iframe = document.createElement('iframe');
   iframe.setAttribute('mozbrowser', true);
   iframe.setAttribute('remote', false);
   iframe.src = 'file_NestedFramesOuter.html#' + browserElementTestHelpers.emptyPage1;
 
   // Note that this is the process corresponding to the /inner/ iframe.  The
   // outer iframe runs in-process (because it has remote=false).
   var childID = null;
-  expectOnlyOneProcessCreated().then(function(chid) {
-    childID = chid;
-    return Promise.all(
-      [expectPriorityChange(childID, 'FOREGROUND'),
-       expectMozbrowserEvent(iframe, 'loadend')]
-    );
-  }).then(function() {
+  Promise.all(
+    [expectOnlyOneProcessCreated().then(function(child) {
+       childID = child;
+       return expectPriorityChange(childID, 'FOREGROUND');
+     }),
+     expectMozbrowserEvent(iframe, 'loadend')]
+  ).then(function() {
     // Send the outer iframe into the background.  This should change the
     // priority of the inner frame's process to BACKGROUND.
     var p = expectPriorityChange(childID, 'BACKGROUND');
     iframe.setVisible(false);
     return p;
   }).then(function() {
     var p = expectPriorityChange(childID, 'FOREGROUND');
     iframe.setVisible(true);