[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 179/311: Bug 1703917 - Wait for client ID to be set again r=Dexter a=test-only



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit cd448cb73aae62a42a89ab1024073622e928445f
Author: Jan-Erik Rediger <jrediger@xxxxxxxxxxx>
AuthorDate: Wed Mar 16 09:47:20 2022 +0000

    Bug 1703917 - Wait for client ID to be set again r=Dexter a=test-only
    
    This hints at an actual case:
    
    When enabling telemetry and _quickly_ closing the browser afterwards,
    telemetry might get enabled and trigger a shutdown ping, but will not
    have initiated setting a new client ID.
    
    This is unlikely to be hit for any real-user scenario: Toggling
    telemetry requires UI interaction (either in the preferences or in
    about:config) and thus is unlikely to be followed by a shutdown quickly
    enough.
    
    Differential Revision: https://phabricator.services.mozilla.com/D140965
---
 .../tests/client/test_deletion_request_ping.py          | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/toolkit/components/telemetry/tests/marionette/tests/client/test_deletion_request_ping.py b/toolkit/components/telemetry/tests/marionette/tests/client/test_deletion_request_ping.py
index cb07c6b2dba8c..d2cdab9795937 100644
--- a/toolkit/components/telemetry/tests/marionette/tests/client/test_deletion_request_ping.py
+++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_deletion_request_ping.py
@@ -44,6 +44,23 @@ class TestDeletionRequestPing(TelemetryTestCase):
         # Turn Telemetry back on.
         self.enable_telemetry()
 
+        # Enabling telemetry resets the client ID,
+        # so we can wait for it to be set.
+        #
+        # **WARNING**
+        #
+        # This MUST NOT be used outside of telemetry tests to wait for that kind of signal.
+        # Reach out to the Telemetry Team if you have a need for that.
+        with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
+            return self.marionette.execute_async_script(
+                """
+                let [resolve] = arguments;
+                Cu.import("resource://gre/modules/ClientID.jsm");
+                ClientID.getClientID().then(resolve);
+                """,
+                script_timeout=1000,
+            )
+
         # Close Firefox cleanly, collecting its "main"/"shutdown" ping.
         main_ping = self.wait_for_ping(self.restart_browser, MAIN_SHUTDOWN_PING)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits