зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635806 - [testing] Expose eventName in BrowserTestUtils.waitForContentEvent r=ahal
This should make it easier to write tests for race-conditions, as the resolving value now indicates which event was received. This required updating a test which for some reason asserted undefined being the resolving value, as a way of "testing" if the Promise resolved at all. Since await already throws Errors when it is rejected, and the test throws a timeout if it doesn't resolve in time, this assertion was removed. It did not add any value. Differential Revision: https://phabricator.services.mozilla.com/D74124
This commit is contained in:
Родитель
bc2c84ac2b
Коммит
2dcc34270a
|
@ -106,8 +106,7 @@ add_task(async function() {
|
|||
"fullscreenchange"
|
||||
);
|
||||
EventUtils.synthesizeKey("KEY_Escape");
|
||||
state = await fullscreenExitPromise;
|
||||
ok(!state, "The content should have exited fullscreen");
|
||||
await fullscreenExitPromise;
|
||||
ok(!document.fullscreenElement, "The chrome should have exited fullscreen");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
|
|
@ -1193,7 +1193,7 @@ var BrowserTestUtils = {
|
|||
eventName,
|
||||
() => {
|
||||
removeEventListener();
|
||||
resolve();
|
||||
resolve(eventName);
|
||||
},
|
||||
{ capture, wantUntrusted },
|
||||
checkFn
|
||||
|
|
Загрузка…
Ссылка в новой задаче