Bug 1299631 - Avoid accessing dead windows in test-firefox-windows.js. r=zer0
authorEric Rahm <erahm@mozilla.com>
Thu, 01 Sep 2016 15:28:14 -0700
changeset 312369 0cfb84806c0863af4facbdde2b37ac5fdd40567c
parent 312368 78bf92d3a0f138ff39eeb20062f206eb48cc9b88
child 312370 657ba2f2611c714d718fb0268acfd5e60ff44310
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszer0
bugs1299631
milestone51.0a1
Bug 1299631 - Avoid accessing dead windows in test-firefox-windows.js. r=zer0 Rather than checking for window.closed we can just check the number of active windows.
addon-sdk/source/test/windows/test-firefox-windows.js
--- a/addon-sdk/source/test/windows/test-firefox-windows.js
+++ b/addon-sdk/source/test/windows/test-firefox-windows.js
@@ -284,20 +284,20 @@ exports.testActiveWindow = function*(ass
     onFocus(rawWindow3).then(resolve);
     window3.activate();
     assert.pass("activating window3");
   });
 
   assert.equal(windows.activeWindow.title, window3.title, "Correct active window - 3");
 
   yield close(rawWindow2);
-  assert.equal(rawWindow2.closed, true, 'window 2 is closed');
+  yield close(rawWindow3);
 
-  yield close(rawWindow3);
-  assert.equal(rawWindow3.closed, true, 'window 3 is closed');
+  assert.equal(windows.length, 1, "Correct number of browser windows");
+  assert.equal(window.closed, false, "Original window is still open");
 };
 
 exports.testTrackWindows = function(assert, done) {
   let windows = [];
   let actions = [];
 
   let expects = [
     "activate 0", "global activate 0", "deactivate 0", "global deactivate 0",