Bug 1761634 - [mozharness] Use driver.quit() instead of custom shutdown script evaluation. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D219836
This commit is contained in:
Henrik Skupin 2024-08-22 10:19:09 +00:00
parent 5001c3afeb
commit 265da4bd9e

View File

@ -245,23 +245,10 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
timeout = 360 timeout = 360
time.sleep(timeout) time.sleep(timeout)
driver.set_context("chrome") driver.quit(in_app=True)
driver.execute_script(
"""
let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
.createInstance(Components.interfaces.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
return cancelQuit.data;
"""
)
driver.execute_script(
"""
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit)
"""
)
# There is a delay between execute_script() returning and the profile data # Bug 1914354: Remove polling of the profile data which is no longer
# actually getting written out, so poll the device until we get a profile. # needed when using the quit() command from Marionette.
for i in range(50): for i in range(50):
if not adbdevice.process_exist(app): if not adbdevice.process_exist(app):
break break