Bug 1258897 - Fix test_ext_sendmessage_reply2.html intermittency and re-enable. r=mixedpuppy

This patch should fix the test_ext_sendmessage_reply2.html intermittency which, based on the
timeout failure that I've been able to intermittently reproduce when running this test
locally using --verify, seems to be likely due to the following race:

the tabs.create API (used to create the extension tabs used as part of the tests) was called
right before subscribing the extension message listeners, and so from time to time the
extension tabs were not able to successfully send their messages to the background page listeners
(because the background page didn't subscribe the listeners yet) and as a result the test was getting
stuck waiting for extension messages that were never going to be received.

Differential Revision: https://phabricator.services.mozilla.com/D17849

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Luca Greco 2019-01-29 15:50:42 +00:00
Родитель bbe407fb99
Коммит b4cdfc9841
2 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -109,7 +109,6 @@ skip-if = (toolkit == 'android') # bug 1342577
[test_ext_sendmessage_no_receiver.html]
[test_ext_sendmessage_reply.html]
[test_ext_sendmessage_reply2.html]
skip-if = true # Bug 1258897
[test_ext_storage_manager_capabilities.html]
scheme=https
[test_ext_subframes_privileges.html]

Просмотреть файл

@ -14,8 +14,6 @@
"use strict";
function backgroundScript(token, id, otherId) {
browser.tabs.create({url: "tab.html"});
browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`);
@ -51,6 +49,8 @@ function backgroundScript(token, id, otherId) {
browser.test.fail(`${id}: Unexpected runtime external message received: ${msg} ${uneval(sender)}`);
}
});
browser.tabs.create({url: "tab.html"});
}
function contentScript(token, id, otherId) {