Skip to content

Commit

Permalink
Bug 689291 test-tabs.test window focus changes active tab | Test outp…
Browse files Browse the repository at this point in the history
…ut exceeded timeout (60s). r=Mossop
  • Loading branch information
erikvold committed Aug 14, 2013
1 parent 6887703 commit d77951d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions addon-sdk/source/test/tabs/test-firefox-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,18 +834,29 @@ exports.testAttachUnwrapped = function (test) {

exports['test window focus changes active tab'] = function(test) {
test.waitUntilDone();

let url1 = "data:text/html;charset=utf-8," + encodeURIComponent("test window focus changes active tab</br><h1>Window #1");

let win1 = openBrowserWindow(function() {
test.pass("window 1 is open");

let win2 = openBrowserWindow(function() {
tabs.on("activate", function onActivate() {
test.pass("window 2 is open");

tabs.on("activate", function onActivate(tab) {
tabs.removeListener("activate", onActivate);
test.pass("activate was called on windows focus change.");
closeBrowserWindow(win1, function() {
closeBrowserWindow(win2, function() { test.done(); });
});
test.assertEqual(tab.url, url1, 'the activated tab url is correct');

close(win2).then(function() {
test.pass('window 2 was closed');
return close(win1);
}).then(test.done.bind(test));
});

win1.focus();
}, "data:text/html;charset=utf-8,test window focus changes active tab</br><h1>Window #2");
}, "data:text/html;charset=utf-8,test window focus changes active tab</br><h1>Window #1");
}, url1);
};

exports['test ready event on new window tab'] = function(test) {
Expand Down

0 comments on commit d77951d

Please sign in to comment.