From d43c48624c352790d723ebb1697a89347065d776 Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Wed, 19 Dec 2018 14:26:22 +0000 Subject: [PATCH] Bug 1515320 - Fix functionality to retrieve the current search engine in TestSearchCounts; r=janerik Differential Revision: https://phabricator.services.mozilla.com/D14966 --- .../tests/client/test_search_counts_across_sessions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toolkit/components/telemetry/tests/marionette/tests/client/test_search_counts_across_sessions.py b/toolkit/components/telemetry/tests/marionette/tests/client/test_search_counts_across_sessions.py index ee82715a7e303..cf735efdc2f6d 100644 --- a/toolkit/components/telemetry/tests/marionette/tests/client/test_search_counts_across_sessions.py +++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_search_counts_across_sessions.py @@ -14,25 +14,25 @@ class TestSearchCounts(TelemetryTestCase): """Test for SEARCH_COUNTS across sessions.""" - def get_current_search_engine(self): - """Retrieve the identifier of the current search engine.""" + def get_default_search_engine(self): + """Retrieve the identifier of the default search engine.""" script = """\ let searchService = Components.classes[ "@mozilla.org/browser/search-service;1"] .getService(Components.interfaces.nsIBrowserSearchService); - return searchService.currentEngine.identifier; + return searchService.defaultEngine.identifier; """ return self.marionette.execute_script(textwrap.dedent(script)) def setUp(self): - """Set up the test case and store the identifier of the current + """Set up the test case and store the identifier of the default search engine, which is required for reading SEARCH_COUNTS from keyed histograms in pings. """ super(TestSearchCounts, self).setUp() - self.search_engine = self.get_current_search_engine() + self.search_engine = self.get_default_search_engine() def search(self, text): """Perform a search via the browser's location bar."""