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 176342 b0878c5c1000dbbc1eb7ec7e30fae06667f84c8b
parent 176341 ef6a5ec3eb108e5a4cb7999dbdb8700041ff775b
child 176343 90ed118bdf5fcdcac58ac4d894d186e4935a423c
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, test-only
bugs873661
milestone28.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);