Bug 1675094 Replace executeSoon() with waitForTick() in accessible/tests/browser r=Jamie,yzen
authorAndrey Bienkowski <hexagonrecursion@gmail.com>
Thu, 05 Nov 2020 18:27:40 +0000
changeset 556110 c68ab3e8a465e653107aa8889c0c7b8f982ab205
parent 556109 5de9e0b0af4151d11cf5afbe8176262efdbc1b6d
child 556111 ea88b243717a1dcdc2c02a57af70685959c5d649
push id37925
push userapavel@mozilla.com
push dateFri, 06 Nov 2020 04:14:34 +0000
treeherdermozilla-central@81a3ef82469b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie, yzen
bugs1675094
milestone84.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1675094 Replace executeSoon() with waitForTick() in accessible/tests/browser r=Jamie,yzen Differential Revision: https://phabricator.services.mozilla.com/D95779
accessible/tests/browser/browser_shutdown_acc_reference.js
accessible/tests/browser/browser_shutdown_doc_acc_reference.js
accessible/tests/browser/browser_shutdown_multi_acc_reference_doc.js
accessible/tests/browser/browser_shutdown_multi_acc_reference_obj.js
accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_doc.js
accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_obj.js
accessible/tests/browser/browser_shutdown_multi_reference.js
accessible/tests/browser/browser_shutdown_parent_own_reference.js
accessible/tests/browser/browser_shutdown_proxy_acc_reference.js
accessible/tests/browser/browser_shutdown_proxy_doc_acc_reference.js
accessible/tests/browser/browser_shutdown_remote_own_reference.js
--- a/accessible/tests/browser/browser_shutdown_acc_reference.js
+++ b/accessible/tests/browser/browser_shutdown_acc_reference.js
@@ -45,17 +45,17 @@ add_task(async function() {
 
   accService = null;
   ok(!accService, "Service is removed");
 
   // Force garbage collection that should not trigger shutdown because there is
   // a reference to an accessible object.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Now allow a11y service to shutdown.
   canShutdown = true;
   // Remove a reference to an accessible object.
   acc = null;
   ok(!acc, "Accessible object is removed");
 
   // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_doc_acc_reference.js
+++ b/accessible/tests/browser/browser_shutdown_doc_acc_reference.js
@@ -37,17 +37,17 @@ add_task(async function() {
 
   accService = null;
   ok(!accService, "Service is removed");
 
   // Force garbage collection that should not trigger shutdown because there is
   // a reference to an accessible document.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Now allow a11y service to shutdown.
   canShutdown = true;
   // Remove a reference to an accessible document.
   docAcc = null;
   ok(!docAcc, "Accessible document is removed");
 
   // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_multi_acc_reference_doc.js
+++ b/accessible/tests/browser/browser_shutdown_multi_acc_reference_doc.js
@@ -48,26 +48,26 @@ add_task(async function() {
 
   accService = null;
   ok(!accService, "Service is removed");
 
   // Force garbage collection that should not trigger shutdown because there are
   // references to accessible objects.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Remove a reference to an accessible object.
   acc = null;
   ok(!acc, "Accessible object is removed");
   // Force garbage collection that should not trigger shutdown because there is
   // a reference to an accessible document.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Now allow a11y service to shutdown.
   canShutdown = true;
   // Remove a reference to an accessible document.
   docAcc = null;
   ok(!docAcc, "Accessible document is removed");
 
   // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_multi_acc_reference_obj.js
+++ b/accessible/tests/browser/browser_shutdown_multi_acc_reference_obj.js
@@ -48,26 +48,26 @@ add_task(async function() {
 
   accService = null;
   ok(!accService, "Service is removed");
 
   // Force garbage collection that should not trigger shutdown because there are
   // references to accessible objects.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Remove a reference to an accessible document.
   docAcc = null;
   ok(!docAcc, "Accessible document is removed");
   // Force garbage collection that should not trigger shutdown because there is
   // a reference to an accessible object.
   forceGC();
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Now allow a11y service to shutdown.
   canShutdown = true;
   // Remove a reference to an accessible object.
   acc = null;
   ok(!acc, "Accessible object is removed");
 
   // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_doc.js
+++ b/accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_doc.js
@@ -57,26 +57,26 @@ add_task(async function() {
       );
 
       accService = null;
       ok(!accService, "Service is removed");
       // Force garbage collection that should not trigger shutdown because there
       // is a reference to an accessible proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Remove a reference to an accessible proxy.
       acc = null;
       ok(!acc, "Accessible proxy is removed");
       // Force garbage collection that should not trigger shutdown because there is
       // a reference to an accessible document proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Now allow a11y service to shutdown.
       canShutdown = true;
       // Remove a last reference to an accessible document proxy.
       docAcc = null;
       ok(!docAcc, "Accessible document proxy is removed");
 
       // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_obj.js
+++ b/accessible/tests/browser/browser_shutdown_multi_proxy_acc_reference_obj.js
@@ -57,26 +57,26 @@ add_task(async function() {
       );
 
       accService = null;
       ok(!accService, "Service is removed");
       // Force garbage collection that should not trigger shutdown because there
       // is a reference to an accessible proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Remove a reference to an accessible document proxy.
       docAcc = null;
       ok(!docAcc, "Accessible document proxy is removed");
       // Force garbage collection that should not trigger shutdown because there is
       // a reference to an accessible proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Now allow a11y service to shutdown.
       canShutdown = true;
       // Remove a last reference to an accessible proxy.
       acc = null;
       ok(!acc, "Accessible proxy is removed");
 
       // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_multi_reference.js
+++ b/accessible/tests/browser/browser_shutdown_multi_reference.js
@@ -40,17 +40,17 @@ add_task(async function() {
   // Remove first a11y service reference.
   accService1 = null;
   ok(!accService1, "Service is removed");
   // Force garbage collection that should not trigger shutdown because there is
   // another reference.
   forceGC();
 
   // Have some breathing room when removing a11y service references.
-  await new Promise(resolve => executeSoon(resolve));
+  await TestUtils.waitForTick();
 
   // Now allow a11y service to shutdown.
   canShutdown = true;
   // Remove last a11y service reference.
   accService2 = null;
   ok(!accService2, "Service is removed");
   // Force garbage collection that should trigger shutdown.
   forceGC();
--- a/accessible/tests/browser/browser_shutdown_parent_own_reference.js
+++ b/accessible/tests/browser/browser_shutdown_parent_own_reference.js
@@ -73,17 +73,17 @@ add_task(async function() {
       // Remove a11y service reference in content and force garbage collection.
       // This should not trigger shutdown since a11y was originally initialized by
       // the main process.
       await SpecialPowers.spawn(browser, [], () => {
         content.CommonUtils.clearAccService();
       });
 
       // Have some breathing room between a11y service shutdowns.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       info("Removing a service in parent");
       // Now allow a11y service to shutdown in content.
       contentCanShutdown = true;
       // Remove the a11y service reference in the main process.
       const [
         parentA11yShutdownObserver,
         parentA11yShutdown,
--- a/accessible/tests/browser/browser_shutdown_proxy_acc_reference.js
+++ b/accessible/tests/browser/browser_shutdown_proxy_acc_reference.js
@@ -52,17 +52,17 @@ add_task(async function() {
       );
 
       accService = null;
       ok(!accService, "Service is removed");
       // Force garbage collection that should not trigger shutdown because there
       // is a reference to an accessible proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Now allow a11y service to shutdown.
       canShutdown = true;
       // Remove a last reference to an accessible proxy.
       divAcc = null;
       ok(!divAcc, "Accessible proxy is removed");
 
       // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_proxy_doc_acc_reference.js
+++ b/accessible/tests/browser/browser_shutdown_proxy_doc_acc_reference.js
@@ -54,17 +54,17 @@ add_task(async function() {
       );
 
       accService = null;
       ok(!accService, "Service is removed");
       // Force garbage collection that should not trigger shutdown because there
       // is a reference to an accessible proxy.
       forceGC();
       // Have some breathing room when removing a11y service references.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       // Now allow a11y service to shutdown.
       canShutdown = true;
       // Remove a last reference to an accessible document proxy.
       docAcc = null;
       ok(!docAcc, "Accessible document proxy is removed");
 
       // Force garbage collection that should now trigger shutdown.
--- a/accessible/tests/browser/browser_shutdown_remote_own_reference.js
+++ b/accessible/tests/browser/browser_shutdown_remote_own_reference.js
@@ -151,17 +151,17 @@ add_task(async function() {
             MainProcess: false,
             PlatformAPI: false,
           },
           "Accessibility service consumers in content are correct."
         )
       );
 
       // Have some breathing room between a11y service shutdowns.
-      await new Promise(resolve => executeSoon(resolve));
+      await TestUtils.waitForTick();
 
       info("Removing a service in content");
       // Now allow a11y service to shutdown in content.
       contentCanShutdown = true;
       [
         contentConsumersChangedObserver,
         contentConsumersChanged,
       ] = accConsumersChanged(browser);